Skip to main content

Use the Python turtle to write SVG files.

Project description

SaVaGe Turtle Build Badge Coverage Badge Downloads Badge PyPI Badge Supported Python versions

Use the Python turtle to write SVG files

If you're using the Python turtle module to teach students, or you just like using the turtle module yourself, this library can save the images from a turtle script as SVG files. Experiment with your turtle code using the regular turtle or the Live Coding in Python plugin for PyCharm, then pass an SvgTurtle to the same code, and save it as an SVG file. If you want to produce other file formats, use svglib to convert the SVG to PDF, PNG, GIF, JPG, TIFF, and PCT, among others.

Installing

Install it with pip install svg_turtle. If you haven't installed Python packages before, read Brett Cannon's quick-and-dirty guide.

Drawing

Once it's installed, create an SvgTurtle, telling it how big to make the SVG file. Then give it some turtle commands, and save the file.

from svg_turtle import SvgTurtle

t = SvgTurtle(500, 500)
t.forward(200)
t.dot(10)
t.save_as('example.svg')

More Information

If you'd like to help out with the project, see the CONTRIBUTING.md file in the source code.

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

svg_turtle-0.4.3.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

svg_turtle-0.4.3-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file svg_turtle-0.4.3.tar.gz.

File metadata

  • Download URL: svg_turtle-0.4.3.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.10

File hashes

Hashes for svg_turtle-0.4.3.tar.gz
Algorithm Hash digest
SHA256 939deda3abfc789d8f7090473cbb2cf90719ee71cf5f0005be085c26d1c07f46
MD5 7cd92d4069f6496f56b0405384d76a53
BLAKE2b-256 285a4ae942460c922b64f12521046ae3dc094ee234c5fec87d5c9d6a0ac0471f

See more details on using hashes here.

File details

Details for the file svg_turtle-0.4.3-py3-none-any.whl.

File metadata

  • Download URL: svg_turtle-0.4.3-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.10

File hashes

Hashes for svg_turtle-0.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 90d38588834f21067afa36febb1a7e6f3277e52162055e683c048e86e2b2b0c7
MD5 7fd376a115eb6495c6ee98ab35a77e0d
BLAKE2b-256 c72da44f3b800deb69b7d9633582d33d517cd829663ffe59f383391f7f631778

See more details on using hashes here.

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