Keeping Python Turtle Graphics window open Follow
First question from a beginner with PyCharm Edu
I try some simple Python example files and when I run
import turtle
t=turtle.Pen()
t.forward(50)
I see the graph window for only a fraction of second and then it disappears. Is there a way to handle this or should I keep on using the ugly IDLE editor?
Thanks !
Please sign in to leave a comment.
Hi Alexis
I'm also just beginning to learn Python and at 70 years old.I have been using the Python IDLE and was surprised to see when using PyCharm that the turtle screen rapidly disappear when the script finished. I work around this by adding two lines of script at the end
import time
time.sleep()
Just put in the delay in seconds within the brackets, I hope this helps, I've no doubt there's a better way.
Brian
I got a solution on stackoverflow somewhere (lost the link)... but the person asked me to add
and it worked.
After you write your code you need to type.
It will keep the window up for as long as you like.