Python turtle Functions

EditRocket provides the following information on turtle functions in the Python source code builder.

backward(distance) - Go backward distance steps.

begin_fill() - Switch turtle into filling mode; Must eventually be followed by a corresponding end_fill() call.

circle(radius[, extent]) - Draw a circle with radius radius whose center-point is radius units left of the turtle.

clear() - Clear the screen.

color(s) -

degrees() - Set angle measurement units to degrees.

delay(delay) - Set the speed of the turtle to delay, which is given in ms.

demo() - Exercise the module a bit.

done() - Enters the Tk main loop.

down() - Move the pen down -- draw when moving.

end_fill() - End filling mode, and fill the shape; equivalent to fill(0).

fill(flag) - The complete specifications are rather complex, but the recommended usage is: call fill(1) before drawing a path you want to fill, and call fill(0) when you finish to draw the path.

forward(distance) - Go forward distance steps.

goto(x, y) -

heading() - Return the current orientation of the turtle.

left(angle) - Turn left angle units.

position() - Return the current location of the turtle as an (x,y) pair.

radians() - Set angle measurement units to radians.

reset() - Clear the screen, re-center the pen, and set variables to the default values.

right(angle) - Turn right angle units.

setheading(angle) - Set the orientation of the turtle to angle.

setup(**kwargs) - Sets the size and position of the main window.

setx(x) - Set the x coordinate of the turtle to x.

sety(y) - Set the y coordinate of the turtle to y.

speed(speed) - Set the speed of the turtle.

title(title_str) - Set the window's title to title.

towards(x, y) - Return the angle of the line from the turtle's position to the point x, y.

tracer(flag) - Set tracing on/off (according to whether flag is true or not).

up() - Move the pen up -- stop drawing.

width(width) - Set the line width to width.

window_height() - Return the height of the canvas window.

window_width() - Return the width of the canvas window.

write(text[, move]) - Write text at the current pen position.