so I want my program to do some lines of code then open turtle window do some staff, close it, do some code again and open turtle window. I have tried turtle.clear()
, turtle.reset()
, turtle.resetscreen()
, turtle.clearscreen()
, turtle.exitonclick()
, but none of it clears entirely, close it and when I need it again, gives me ability to open it.
so can you help me.
CodePudding user response:
You question has been answered here. if this doesn't help please go through the documentation.
CodePudding user response:
import turtle, time
screen = turtle.Screen()
turtle.color('orange')
turtle.pensize(3)
turtle.circle(75)
time.sleep(5)
# close
screen.bye()
# or turtle.Screen().bye()