Python Turtle Graphics Window only Opens Briefly then Closes

Randoms picture Randoms · Sep 26, 2013 · Viewed 13.7k times · Source

I have recently begun using the turtle module in Python, and I admit, I am a complete novice. I have been having trouble getting the graphics window in which the turtle does its drawing to stay open. Even when I try to run something as simple as this:

import turtle
wn = turtle.Screen()
tur = turtle.Turtle()
tur.forward(50)

all I get is the Python launcher icon to appear on my dock for a split second and close. Any help is appreciated, and I am, by the way, doing this in Aptana Studio 3.

Answer

5813 picture 5813 · Oct 3, 2013

Also, you may want to try

turtle.mainloop()

which in my opinion just works slightly better than with Tk.