Skip to main content

Turtle graphics based on ipycanvas which can run on jupyter lab/vscode.

Project description

Demo

Demo

https://github.com/williamnavaraj/ipyturtle3/blob/main/Images/TurtleWin.gif

Usage: Installation

pip install ipyturtle3

Example ipynb code. Run this in a cell.

import ipyturtle3 as turtle
from ipyturtle3 import hold_canvas
myCanvas=turtle.Canvas(width=500,height=250)
display(myCanvas)
myTS=turtle.TurtleScreen(myCanvas)
myTS.clear()
myTS.bgcolor("lightgreen")
bob=turtle.Turtle(myTS)
jess=turtle.Turtle(myTS,isHolonomic=True)
jess.shape("square")
bob.shape("turtle")

myTS.delay(200)
# Usual turtle Non-holonomic example
bob.forward(50)
bob.left(90)
bob.forward(50)
bob.left(90)
bob.forward(50)
bob.left(90)
bob.forward(50)


#Holonomic
jess.moveleft(200)
jess.moveup(100)
jess.moveright(100)
jess.movedown(100)
jess.turnright(45)
jess.turn(-45)
jess.distance_at_angle(50,45)

myTS.clear()

# Rainbow benzene
colors = ['red', 'purple', 'blue', 'green', 'orange', 'yellow']
t = turtle.Turtle(myTS)
myTS.bgcolor('black')
for x in range(50):
    with(hold_canvas(myCanvas)):
        t.pencolor(colors[x%6])
        t.width(x//100 + 1)
        t.forward(x)
        t.left(59)

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

ipyturtle3-0.1.2.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ipyturtle3-0.1.2-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file ipyturtle3-0.1.2.tar.gz.

File metadata

  • Download URL: ipyturtle3-0.1.2.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.11.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for ipyturtle3-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f0fa74d94ea6d689235ba747083a68dacc8786637eb1179ef03036d99515dc68
MD5 8706ec8086790602c547ffdec1b1ffab
BLAKE2b-256 71ef54f29b0b4d2c73f195e195645318e1dfec1ca068a8e611f6cf36988badbf

See more details on using hashes here.

File details

Details for the file ipyturtle3-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: ipyturtle3-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.11.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for ipyturtle3-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f881ebbe3c2287448596601f865b3c44b9e6129128174bc0ad66685d97470d74
MD5 c45a1dc5e055145de7ae10b5a7d65614
BLAKE2b-256 2025cbf0526d783490d5ab75156eb057b7d907399976a804b1f2bc356660b213

See more details on using hashes here.

Supported by

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