Some Useful Settings and Methods for Turtle

These tables show some of the values for various methods used in the Python turtle package.

Speed

The methods that require a speed with which to move the cursor (turtle) take an integer argument. The integer is between 0 and 10, with 0 meaning no animated motion and 10 meaning the fastest animated motion. So if you have the speed set to 0, the turtle will jump around as you move it; there will be no animation.

Turtle Commands

Color

The methods that require a color use a color specification string. The more common ones are:
black  cyan  green  pink  violet
blue  gold  magenta  purple  white
brown  gray  orange  red  yellow
A full list can be found at http://www.tcl.tk/man/tcl8.5/TkCmd/colors.htm. You can also specify colors as mixtures or red, green, and blue as #rrggbb, where rr, gg, and bb are two hexadecimal digits each indicating the intensity of the color (with “00” meaning the color isn’t present and “FF” meaning it is as intense as possible).

Turtle Commands

Shapes

The methods that require a shape for the cursor (turtle) know the following shapes:
arrow  turtle  circle  square  triangle  classic
Turtle Commands

Drawing Things

A “pen” is associated with each turtle. The pen can be in the “up” state or the “down” state. When you move the cursor (turtle), if the pen is down, the turtle draws a line from the current position to the new one. If the pen is up, the position of the turtle changes to the new one, but no line is drawn.

You can draw a dot or a circle of a given size, too.

You can also write text at the current location of the mouse.

Turtle Commands

Coloring in Shapes (Filling Shapes)

You can color in, or “fill”, a shape such as a rectangle or circle (or, really, anything). To do this, say you want to begin filling the shape then draw the shape, then say you are done. Filling is associated with a turtle, so if you have several active turtles, the filling is done only for the one(s) you indicate.

By default, the fill color is the color of the turtle. You can change it to another color as described in the section Color, above.

Turtle Commands

More About Turtle

The reference document for turtle is Chapter 24.1, “Turtle Graphics”, of Python Setup and Usage, available at https://docs.python.org/3.4/library/turtle.html.
You can also obtain a PDF version of this. Version of April 18, 2014 at 10:21PM