Drawing with turtle(python) using PyCharm

DanyC picture DanyC · Nov 4, 2014 · Viewed 24.5k times · Source

I'm running the latest PyCharm Pro version and trying to run the below code from a scratch file but it doesn't seem to work

import turtle

wn = turtle.Screen() 
alex = turtle.Turtle()
alex.forward(150)  
alex.left(90) 
alex.forward(75)

By not working I mean, no window is popping out however I do see in the output saying

Process finished with exit code 0

Any idea

  1. If it can be done via PyCharm
  2. What am I missing in terms of configuration

Cheers

Answer

Allan Anderson picture Allan Anderson · Nov 23, 2014

I ran into the same problem. Turns out the solution is in the "turtle" module.

You want to end with

turtle.done()

or

turtle.exitonclick()

Enjoy!