Slow turtle

Peter Otten __peter__ at web.de
Sat Jul 31 04:04:19 EDT 2004


Brent W. Hughes wrote:

> I'm using the turtle graphics module and am trying to teach it to my kids.
> The slowness of the turtle in drawing things is good at first because it's
> fun watching it do its thing.  But now we'd like it to go faster so it
> doesn't take to long to see what it is producing. Is there a standard way
> to speed it up, or am I left with sifting through the source code to fix
> it myself?

If you are only interested in the final picture, you can use tracer(False).
Otherwise reducing the delay or dividing nhops by a fixed number seem most
promising. E. g.

262c262
<                 nhops = int(distance)
---
>                 nhops = int(distance)/5
273c273
<                         self._canvas.after(10)
---
>                         self._canvas.after(1)

Peter





More information about the Python-list mailing list