How to hide a turtle icon/pointer in Python

Bryant picture Bryant · Sep 27, 2015 · Viewed 42.8k times · Source

When using Python Turtle, how do you hide turtle icon(s)/pointer(s) in turtle graphics in Turtle code so that it won't show when testing?

Answer

Peter Wood picture Peter Wood · Sep 27, 2015

The documentation has a section on Visibility:

turtle.hideturtle()
turtle.ht()
Make the turtle invisible. It’s a good idea to do this while you’re in the middle of doing some complex drawing, because hiding the turtle speeds up the drawing observably.

>>> turtle.hideturtle()

Also, you can un-hide the turtle:

turtle.showturtle()
turtle.st()
Make the turtle visible.

>>> turtle.showturtle()

You can also query its visibilty:

turtle.isvisible()
Return True if the Turtle is shown, False if it’s hidden.

>>> turtle.hideturtle()
>>> turtle.isvisible()
False
>>> turtle.showturtle()
>>> turtle.isvisible()
True