Skip to content

nickichann01/Turtle-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Turtle-Python 🐢

🖥️ turtle — Turtle graphics

The turtle module is a graphics library in Python that allows you to control a turtle and draw shapes and patterns on the screen. It is a fun and easy way to get started with programming and computer graphics.

To install Turtle, run this command in your terminal:

$ pip install turtle

Here are some turtle methods

Turtle motion

Move and draw

forward() | fd()
backward() | bk() | back()
right() | rt()
left() | lt()
goto() | setpos() | setposition()
setx()
sety()
setheading() | seth()
home()
circle()
dot()
stamp()
clearstamp()
clearstamps()
undo()
speed()

Tell Turtle’s state

position() | pos()
towards()
xcor()
ycor()
heading()
distance()

Setting and measurement

degrees()
radians()

Pen Control

Drawing State

pendown() | pd() | down()
penup() | pu() | up()
pensize() | width()
pen()
isdown()

Color control

color()
pencolor()
fillcolor()
Filling
filling()
begin_fill()
end_fill()

More drawing control

reset()
clear()
write()

Turtle State

Visibility

showturtle() | st()
hideturtle() | ht()
isvisible()

Appearance

shape()
resizemode()
shapesize() | turtlesize()
shearfactor()
settiltangle()
tiltangle()
tilt()
shapetransform()
get_shapepoly()

Using events

onclick()
onrelease()
ondrag()

Special Turtle methods

begin_poly()
end_poly()
get_poly()
clone()
getturtle() | getpen()
getscreen()
setundobuffer()
undobufferentries()

Here are some Methods of TurtleScreen/Screen

Window Control

bgcolor()
bgpic()
clearscreen()
resetscreen()
screensize()
setworldcoordinates()

Animation control

delay()
tracer()
update()

Using screen events

listen()
onkey() | onkeyrelease()
onkeypress()
onclick() | onscreenclick()
ontimer()
mainloop() | done()

Settings and special methods

mode()
colormode()
getcanvas()
getshapes()
register_shape() | addshape()
turtles()
window_height()
window_width()
Input methods
textinput()
numinput()

Methods specific to Screen

bye()
exitonclick()
setup()
title()

Here are some examples:

Geomerty


Avengers Logo


Different shapes


About

Just a study on how to use the turtle library in Python.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages