Turtles 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()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for IPythonDisplayTurtle-0.0.33.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee52ae8a7b47b5e3a7bfd3e633009de894bf71090718570f65e5cdb405ee87d6 |
|
MD5 | 1d38a1365db94aca6af34feff7bb2b33 |
|
BLAKE2b-256 | 58efa4f2a1bdace1eaa2995934ea014335e528420891600223734c5e39255c0d |
Close
Hashes for IPythonDisplayTurtle-0.0.33-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e8d818746df2ae92afbf74182b531b5ccc9112859d5c2f77fd46ae14b6e21b3 |
|
MD5 | 83d3d882b7b8877fc308d386c66aa111 |
|
BLAKE2b-256 | 8412c5b8280bbdf07064da3187d91864394f0ecd29988e31bd3b70f8346a6825 |