We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi! nice work!
I'm trying calysto turtle with ipywidgets, and I would like to clear the canvas.
How can I do that?
Here is my code
import ipywidgets as widgets from IPython.display import display, clear_output from calysto.graphics import * sides = widgets.IntSlider(min=3, max=10, description="Sides") button = widgets.Button(description="Draw!") canvas = Canvas(size=(400, 400)) turtle = Turtle(canvas, (200, 20), 0) def draw_polygon(button): global sizes, canvas, turtle for _ in range(sides.value): turtle.forward(50) turtle.right(360/sides.value) clear_output(wait=True) display(sides, button, canvas) button.on_click(draw_polygon) display(sides, button, canvas)
If I use canvas.clear() then I get
canvas.clear()
ValueError: <Polygon [(-10, 5), (0, 0), (-10, -5), (-5, 0)]> is not in list
Thanks!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi! nice work!
I'm trying calysto turtle with ipywidgets, and I would like to clear the canvas.
How can I do that?
Here is my code
If I use
canvas.clear()
then I getThanks!
The text was updated successfully, but these errors were encountered: