Skip to main content

Fireworks using IPython Display

Project description

WIP

Please note that this is still being actively developed, hence may not work properly for you!

IPythonDisplayTurtle

An implementation of the classic turtle module mainly implemented using IPython.display, IPython.HTML, and paperscript. Can be used with Jupyter Notebooks, and in places where ipywidgets are not supported. Only requires one way communication to work, so great for remote server cases. Also has level drawing capabilities. You can check the source code yourself for more info!

How to install from a terminal/command prompt:

pip install IPythonDisplayTurtle

To install from a jupyter notebook cell:

!pip install IPythonDisplayTurtle

How to use:

from IPythonDisplayTurtle import Snake

colours=["red","orange","yellow","green","blue","purple"]
divisions = 12
angle = 360/divisions 

t = Snake(_pendown = 0)
for i in range(divisions):
    if(i%2 == 0):
        t.pendown()
        t.pencolor(colours[int(i/2)%len(colours)])
    else:
        t.penup()
    t.goforward(300/divisions)
    t.turnright(angle)
t.penup()
t.goforward(120)
t.turnright(360)

t.display()

Example Turtle

Binder

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

IPythonDisplayFireworks-0.0.1.tar.gz (106.2 kB view hashes)

Uploaded Source

Built Distribution

IPythonDisplayFireworks-0.0.1-py3-none-any.whl (108.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page