Skip to content

Python Turtle graphics for Jupyter notebooks

Notifications You must be signed in to change notification settings

fluentpython/jupyturtle2

 
 

Repository files navigation

jupyturtle2

Python Turtle graphics for Jupyter notebooks

For a quick demo, open the lab notebook.

jupyturtle2 is a fork of jupyturtle replacing SVG output with rendering on an ipycanvas widget.

It solves the problem of rendering SVG drawings that grow increasingly slow as lines are added.

But ipycanvas introduces two other problems:

  1. A limited number of steps per second, which requires using delay=0.01 for complex drawings.
  2. The final state of the canvases is not saved with the notebook.

I used metaprogramming techniques to build the procedural API with global functions like fd() to move the turtle. The techniques are easier to understand in the didactic project abacus.

@ramalho

About

Python Turtle graphics for Jupyter notebooks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 83.9%
  • Python 16.1%