turtle-tools


Nameturtle-tools JSON
Version 0.0.1 PyPI version JSON
download
home_page
SummarySimple utilities that extend Turtle
upload_time2023-07-09 20:21:57
maintainer
docs_urlNone
authorYngve Mardal Moe, Marie Roald
requires_python>=3.8
license
keywords education turtle
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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

```raw
pip install turtle-tools
```

## Example

```python
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()
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "turtle-tools",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "education,turtle",
    "author": "Yngve Mardal Moe, Marie Roald",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/16/76/4b79b26d5c7f9c9bd00cb75a4fcc42d6c6abb16ec2906d3f765ed9ee3f16/turtle_tools-0.0.1.tar.gz",
    "platform": null,
    "description": "# Simple utilities that extend the Turtle module\n\nThis code extends the `turtle` module with context managers for the following tasks:\n\n * `turtle.penup`\n * `turtle.pendown`\n * `turtle.color`\n * `turtle.pencolor`\n * `turtle.fillcolor`\n * `turtle.speed`\n * `turtle.fill`\n * `turtle.poly`\n * `turtle.pensize`\n * `disable_autoupdate`\n * `enable_autoupdate`\n\nIn addition to a `save_postscript` function to save the current canvas as an eps file.\n\n## Installation\n\n```raw\npip install turtle-tools\n```\n\n## Example\n\n```python\nimport turtle\nimport turtle_tools\n\nturtle_tools.extend_turtle()\n\npen = turtle.Turtle()\n\nwith disable_autoupdate():\n    for i in range(2):\n        with pen.fill(), pen.color(\"blue\", \"green\"):\n            for i in range(4):\n                pen.forward(100)\n                pen.right(90)\n\n        with pen.penup():\n            pen.forward(150)\n\nwith pen.pensize(5):\n    pen.right(90)\n    pen.penup()\n    pen.forward(200)\n    with pen.pendown():\n        pen.forward(100)\n    pen.right(90)\n    pen.forward(200)\n    pen.pendown()\n    pen.forward(200)\n\nfor i in range(2):\n    with pen.poly(), pen.color(\"red\"):\n        for i in range(4):\n            pen.forward(100)\n            pen.right(90)\n\n    with pen.penup():\n        pen.forward(10)\n\nsave_postscript(\"file.eps\")\nturtle.done()\n```\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Simple utilities that extend Turtle",
    "version": "0.0.1",
    "project_urls": null,
    "split_keywords": [
        "education",
        "turtle"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f946cc2d09e726cc3917cdf6df5fe9843dae0bb2141a4981c2b6c24f42a564d5",
                "md5": "c207ee98da73dec6f1d03c5f235313b7",
                "sha256": "f6c033fe34f3e99ab5fefeea850093574a31b36a71650531322d71e013fcff48"
            },
            "downloads": -1,
            "filename": "turtle_tools-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c207ee98da73dec6f1d03c5f235313b7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 2738,
            "upload_time": "2023-07-09T20:21:55",
            "upload_time_iso_8601": "2023-07-09T20:21:55.807517Z",
            "url": "https://files.pythonhosted.org/packages/f9/46/cc2d09e726cc3917cdf6df5fe9843dae0bb2141a4981c2b6c24f42a564d5/turtle_tools-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "16764b79b26d5c7f9c9bd00cb75a4fcc42d6c6abb16ec2906d3f765ed9ee3f16",
                "md5": "9826b30bcf05c93a6dddb686de67a770",
                "sha256": "4e66ae65298a65066c9333a06d361cfa759131813a97472703b02fb11bca7129"
            },
            "downloads": -1,
            "filename": "turtle_tools-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "9826b30bcf05c93a6dddb686de67a770",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 3708,
            "upload_time": "2023-07-09T20:21:57",
            "upload_time_iso_8601": "2023-07-09T20:21:57.098963Z",
            "url": "https://files.pythonhosted.org/packages/16/76/4b79b26d5c7f9c9bd00cb75a4fcc42d6c6abb16ec2906d3f765ed9ee3f16/turtle_tools-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-09 20:21:57",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "turtle-tools"
}
        
Elapsed time: 1.01709s