Skip to main content

A simplified wrapper for Python's turtle module, perfect for beginners.

Project description

ip1tricks 🐢

A simplified, beginner-friendly wrapper for Python's Turtle graphics.

Created by Scrol.


🌟 Introduction

Welcome to ip1tricks! If you've ever wanted to create beautiful digital art with Python but found the standard turtle module a bit overwhelming, this library is for you. We've simplified the commands so you can focus on your creativity.

Whether you're a Python newbie or a seasoned coder looking for a quick way to draw shapes, ip1tricks makes it easy to create complex patterns like flowers, spirals, and polygons with just a few lines of code.


🚀 Installation

You can install ip1tricks directly from source:

pip install ip1tricks

🎨 Getting Started (For Newbies)

In Python Turtle, you control a small "turtle" on a screen. Think of it like a robot with a pen attached to its tail. As the robot moves, it leaves a trail.

The Basic Workflow:

  1. Import the tools: from ip1tricks import *
  2. Setup: instant() to make it draw fast.
  3. Move and Draw: Use commands like line(), turn(), and arc().
  4. Finish: hide() the turtle and finish() to keep the window open.

📚 Core Concepts & Theory

1. The Coordinate System

The screen is a grid. The center is (0, 0).

  • Moving Forward means moving in the direction the turtle is facing.
  • Turning changes the turtle's direction (Heading).

2. Angles and Shapes

  • A full circle is 360 degrees.
  • To draw a Square, you turn 90 degrees four times (360 / 4).
  • To draw a Triangle, you turn 120 degrees three times (360 / 3).
  • The Rule: To draw a polygon with n sides, you turn 360 / n degrees at each corner.

3. How Arcs Work

An arc is a piece of a circle. We calculate the circumference (the total distance around a circle) using 2 * π * radius. To make the drawing look smooth, we break the arc into many tiny straight lines.

  • Radius: How big the circle would be.
  • Angle: How much of the circle to draw (e.g., 180 for a semi-circle).

🛠 Function Reference

Function What it does Example
move(x, y) teleports the turtle to (x, y) without drawing. move(100, 50)
line(length) Draws a straight line forward. line(100)
turn(angle) Turns left by a number of degrees. turn(90)
polygon(len, sides) Draws a shape with equal sides. polygon(50, 6)
arc(radius, angle) Draws a curved line. arc(100, 60)
circle2(radius) Draws a full circle. circle2(50)
setcolor(c) Changes the pen color. setcolor('red')
instant() Makes the drawing happen immediately. instant()
accelerate() Same as instant(), for faster drawing! accelerate()
hide() Makes the turtle icon disappear. hide()
finish() Stops the window from closing. finish()

🌈 Examples

1. The Classic Flower 🌸

This example uses overlapping arc() commands to create a beautiful floral pattern.

How it works:

  1. We draw two arcs to create one "petal".
  2. We turn slightly (36 degrees).
  3. We repeat this 10 times (10 * 36 = 360) to complete the flower.
from ip1tricks import *

instant()
setcolor('red')

for i in range(10):
    # Draw a petal
    arc(100, 60)
    turn(120)
    arc(100, 60)
    turn(120)
    
    # Rotate for the next petal
    turn(36)

hide()
finish()

Flower Pattern

2. The Vibrant Spiral 🌀

Spirals are created by drawing and turning, but slightly increasing the size or angle each time.

from ip1tricks import *

instant()

for i in range(100):
    setcolor(['red', 'purple', 'blue', 'green'][i % 4])
    line(i * 2)
    turn(91)

hide()
finish()

Spiral Pattern


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

ip1tricks-0.1.2.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ip1tricks-0.1.2-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file ip1tricks-0.1.2.tar.gz.

File metadata

  • Download URL: ip1tricks-0.1.2.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for ip1tricks-0.1.2.tar.gz
Algorithm Hash digest
SHA256 ceca420d9d6786c201f94061f7d4a5077d4d3474bdbcceee7316752cb721a649
MD5 69be5c8dc0d7d69724b9b762d2055737
BLAKE2b-256 9f2cad22805b4b2b8af86bc6726464767cbea3cfceba73b4bb56dd97fcc62938

See more details on using hashes here.

File details

Details for the file ip1tricks-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: ip1tricks-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for ip1tricks-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 14752fd804f1cba20c9ee279d3bb00a1225fc3d0a6f1be7a47425697ad8c46bf
MD5 898eb368cb9964d02f9d932f27b777b9
BLAKE2b-256 a41e5acd2dfdd8bc8cf2d0ea4a018ff14be51c1ecd879538994b30bc60be9752

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page