Skip to main content

Turtle graphics on the web.

Project description

Tortoise: turtle graphics on the web

Version 0.1.0 License

tortoise library example

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 file, with which above picture were generated, is an example of use of this library. Simply launch python from the root of the repository.

The module is also available on Pypi: Simply launch pip install tortoise to install it.

You can also test the library directly in your web browser, with nothing to install:

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:

  • getAngle(): returns the current angel,
  • up(): put the pen up,
  • down(): puts the pen down,
  • setAutoDraw(value): the drawing is automatically rendered each values movements (0 will disable the auto draw); call draw() to render remaining movements,
  • setPosition(x,y): the turtle jumps to x and y, relatively of the center of the drawing area,
  • forward(distance): the tortoise moves by the specified distance,
  • right(angle): the tortoise turns clockwise from angle degrees,
  • right(angle): the tortoise turns counter clockwise from angle degrees,
  • 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.

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

tortoise-0.1.0.tar.gz (3.8 kB view hashes)

Uploaded Source

Built Distribution

tortoise-0.1.0-py3-none-any.whl (5.0 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