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 .

🎨 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.1.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.1-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ip1tricks-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 86ecc4bfd91bbd28bdda7860c624a5f7c714368eda7056923ebde6636c04c067
MD5 e61fb470402a63b0559920199711b6a0
BLAKE2b-256 f1c458d444fa801ce946cd98bef1f8c90506ad3ccedf7caa02c389d8859a2b08

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ip1tricks-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e48e38f38f558d5c71fb2d7a25fc4e497dd0b47137064731d4127fda556cbcdd
MD5 80b996113ab9e0e77b47c2ad6f89c9e3
BLAKE2b-256 6a8de1ffd916fb5220c941efac51a73bd8eee5b1ab48c0571430644a5355e5d9

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