Skip to content

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.

License

Notifications You must be signed in to change notification settings

atahan-git/IPythonDisplayTurtle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WIP

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

Also see: https://github.com/atahan-git/SSSsnake

IPythonDisplayTurtle

An implementation of the classic turtle module mainly created 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.forward(300/divisions)
    t.right(angle)
t.penup()
t.forward(120)
t.right(360)

t.display()

Example Turtle

Binder

About

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.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published