donkirkby / live-py-plugin

Live coding in Python with PyCharm, Emacs, Sublime Text, or even a browser
https://donkirkby.github.io/live-py-plugin
MIT License
291 stars 57 forks source link

Turtle tracer method #357

Closed donkirkby closed 2 years ago

donkirkby commented 2 years ago

What I did

Use the tracer() method in live turtle mode.

import turtle as t

t.forward(100)
t.tracer(10)
t.right(90)
t.forward(200)

t.mainloop()

What happened

I get an error on the tracer() call:

TypeError: tracer() takes from 1 to 2 positional arguments but 3 were given

What I wanted to happen

The live turtle display should show the first line, but not the second one. When I run the script under Python, that's what happens, because the display only updates after every 10 changes. If I call update() explicitly, then it should show both lines.

import turtle as t

t.forward(100)
t.tracer(10)
t.right(90)
t.forward(200)
t.update()

t.mainloop()

My environment

Describe the versions of everything you were using: