|
Turtle
Description
This page has sample files for drawing using Python Turtle.
- The numbered scripts draw abstract art. The other ones contain "helper" methods.
- Except for
001_FirstTurtle.py , the rest need one or more of the following
files to be present:
util.py
palettes.py
colors.py
drawMethods.py
so download those and put them it in your project directory.
-
You will need to install a packaged called PIL
(the package is usually called pillow instead of PIL for some reason)
in order to run these scripts. How to do that depends on what IDE you are using.
This packages allows you to take screenshots of your scripts by just clicking
anywhere in the window. It will name the files the same name as the script,
so if you do it multiple times it will overwrite previously saved images.
Rename your images to avoid this.
Getting Started with Python Turtle
-
Download a suitable IDE for working with Python.
I use PyCharm
-
Download the Python
Turtle Starter Files
and extract the files.
- Drag the four files into your project folder.
001_FirstTurtle.py is very basic and just draws two shapes.
002_CheckerBoard.py draws a simple checkerboard.
003_ColoredSquares.py draws a colored checkerboard.
util.py contains a couple of methods that are used in
002_CheckerBoard.py and 003_ColoredSquares.py
to make the window better.
I recommend that you use the getTurtleAndScreen
method to get your turtle/screen objects in all of your code as is done
in these two scripts.
-
Run these and look at the code. Then start making your own!
- See Turtle Graphics Documentation
to see more about
what Turtles can do.
-
I recommend numbering your files like I did (e.g.
001_FirstTurtle ,
002_CheckerBoard , 003_MyCoolOne , etc.),
and every time you make tweaks that change it significantly enough,
consider copying your file and making a new one so you can keep a history
of all of your scripts.
See the Links
page for many useful links related to Python Turtle, RGB Color, Color Theory, etc.
|