-3

My turtle module does not work in IDE. Can anyone help me?

Code:

import turtle
t = turtle.pen()

I wrote this code to make the turtle module open its app, but it didn't happen.

CristiFati
  • 38,250
  • 9
  • 50
  • 87
arad mns
  • 3
  • 2

1 Answers1

0

You have to add turtle.mainloop() or turtle.done() at the last of the file.

Starts event loop - calling Tkinter’s mainloop function. Must be the last statement in a turtle graphics program. Must not be used if a script is run from within IDLE in -n mode (No subprocess) - for interactive use of turtle graphics.

You can read turtle document for more details.

MingJie-MSFT
  • 5,569
  • 1
  • 2
  • 13