Tortoise: turtle graphics on the web
This repository is the proof of concept of an implementation, in Python, of turtle graphics based on web technologies. This is the main difference with the turtle module, which uses (t|T)kinter.
Cloning the repository (or retrieving the corresponding ZIP file) is sufficient to use this module. The main.py file, with which above picture were generated, is an example of use of this library. Simply launch python main.py from the root of the repository.
The module is also available on Pypi: https://pypi.org/project/tortoise/. Simply launch pip install tortoise to install it.
You can also test the library directly in your web browser, with nothing to install: http://q37.info/s/dj9b7ksf.
This Python module is part of a larger project that aims to provide a way to write modern examples or exercises for programming tutorials.
The tortoise library currently provides following methods (coordinates and distances are relative to the viewbox of the SVG):
- constructor
(dom,id): returns a tortoise object which usesdomas the DOM from the Atlas toolkit, and the SVG element of idid, getAngle(): returns the current angel, in degrees,up(): puts the pen up,down(): puts the pen down,setAutoDraw(value): the drawing is automatically rendered eachvaluemovements (0will disable the auto draw); calldraw()to render remaining movements,setPosition(x,y): the turtle jumps to positionxandy,forward(distance): the tortoise moves by the specifieddistance,right(angle): the tortoise turns clockwise fromangledegrees,left(angle): the tortoise turns counter clockwise fromangledegrees,setColorRGB(r,g,b): sets the color of the pen following the RGB color model,setColorHSL(h,s,l): sets the color of the pen following the HSL color model, (h: 0 - 360;s,l: 0 - 100%),draw(): draws remaining movements,clear(): erase the drawing area and also resets the internal settings (coordinates, angle, color…).
Release files for tortoise 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tortoise-0.1.1.tar.gz | 4.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tortoise-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.4 kB
Release files / tortoise-0.1.1.tar.gz
| Download URL | tortoise-0.1.1.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a4ebd69b152d266174b3b0f2a22e3fb8995101eb749d3114813a98f405ab10bb
|
|
BLAKE2b-256 checksum How to use checksums |
8b98970d10bcc02eda8370c425dd6306526eec8b407aa83f13bb0ebe7da41012
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.4
|
Release files / tortoise-0.1.1-py3-none-any.whl
| Download URL | tortoise-0.1.1-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bcb58a56d6796cad0db330104450df2caf2ea9e98d844bb2906274bd15c12804
|
|
BLAKE2b-256 checksum How to use checksums |
16efb314819f12e48e7a99f07825d064b596d58cc4a0c3b75939d0d10fedf90d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.4
|