Skip to main content

Simple utilities that extend the Turtle module

This code extends the turtle module with context managers for the following tasks:

  • turtle.penup
  • turtle.pendown
  • turtle.color
  • turtle.pencolor
  • turtle.fillcolor
  • turtle.speed
  • turtle.fill
  • turtle.poly
  • turtle.pensize
  • disable_autoupdate
  • enable_autoupdate

In addition to a save_postscript function to save the current canvas as an eps file.

Installation

pip install turtle-tools

Example

import turtle
import turtle_tools

turtle_tools.extend_turtle()

pen = turtle.Turtle()

with disable_autoupdate():
    for i in range(2):
        with pen.fill(), pen.color("blue", "green"):
            for i in range(4):
                pen.forward(100)
                pen.right(90)

        with pen.penup():
            pen.forward(150)

with pen.pensize(5):
    pen.right(90)
    pen.penup()
    pen.forward(200)
    with pen.pendown():
        pen.forward(100)
    pen.right(90)
    pen.forward(200)
    pen.pendown()
    pen.forward(200)

for i in range(2):
    with pen.poly(), pen.color("red"):
        for i in range(4):
            pen.forward(100)
            pen.right(90)

    with pen.penup():
        pen.forward(10)

save_postscript("file.eps")
turtle.done()

Metadata

Release files for turtle-tools 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for turtle-tools 0.0.1
File Size Uploaded Provenance
turtle_tools-0.0.1.tar.gz 3.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for turtle-tools 0.0.1
File Interpreter ABI Platform
turtle_tools-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 6.4 kB

Release files / turtle_tools-0.0.1.tar.gz

Download URL turtle_tools-0.0.1.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4e66ae65298a65066c9333a06d361cfa759131813a97472703b02fb11bca7129
BLAKE2b-256 checksum
How to use checksums
16764b79b26d5c7f9c9bd00cb75a4fcc42d6c6abb16ec2906d3f765ed9ee3f16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.1 CPython/3.11.4

Release files / turtle_tools-0.0.1-py3-none-any.whl

Download URL turtle_tools-0.0.1-py3-none-any.whl
Size 2.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f6c033fe34f3e99ab5fefeea850093574a31b36a71650531322d71e013fcff48
BLAKE2b-256 checksum
How to use checksums
f946cc2d09e726cc3917cdf6df5fe9843dae0bb2141a4981c2b6c24f42a564d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.1 CPython/3.11.4

Security for turtle-tools 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page