如何在Python中隐藏海龟图标/指针

2024-04-19 10:42:12 发布

您现在位置:Python中文网/ 问答频道 /正文


Tags: python
1条回答
网友
1楼 · 发布于 2024-04-19 10:42:12

documentationVisibility上有一个节:

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()

另外,你可以解开乌龟的皮:

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

>>> turtle.showturtle()

您还可以查询其可见性:

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

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

相关问题 更多 >