简体   繁体   中英

Python turtle tracer function isn't working

I tried to use the tracer function to ignore animation to draw the shape quicker. This has worked for me in the past but now after using it it doesn't work. When I put the tracer line in the program does't draw anything; when I take it out it works, but very slowly which is why I wanted to take out animation. Is this function still valid and I am using it wrong or is there a new funcion in it's place> Any recommendations?

#!/usr/bin/python3
import turtle
import random
import time
turtle.tracer(False)

turtle.title("Trippy Shape")
for i in range(360):
    turtle.circle(200)
    turtle.left(1)

Once you turn the tracer off, generally you won't see any drawing until you turn the tracer back on again or send an update() method to the screen. (There are a few turtle operations that will trigger an update() all by themselves.)

import turtle

turtle.title("Trippy Shape")

turtle.tracer(False)

for i in range(360):
    turtle.circle(200)
    turtle.left(1)

turtle.tracer(True)

turtle.mainloop()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM