Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tortoise

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tortoise

Turtle graphics on the web.

  • 0.1.1
  • PyPI
  • Socket score

Maintainers
1

Tortoise: turtle graphics on the web

Version 0.1.1 Download stats 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 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 uses dom as the DOM from the Atlas toolkit, and the SVG element of id id,
  • getAngle(): returns the current angel, in degrees,
  • up(): puts the pen up,
  • down(): puts the pen down,
  • setAutoDraw(value): the drawing is automatically rendered each value movements (0 will disable the auto draw); call draw() to render remaining movements,
  • setPosition(x,y): the turtle jumps to position x and y,
  • forward(distance): the tortoise moves by the specified distance,
  • right(angle): the tortoise turns clockwise from angle degrees,
  • left(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,
  • clear(): erase the drawing area and also resets the internal settings (coordinates, angle, color…).

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc