Trees  Indices  Help 









































































Set angle measurement units to degrees. Example: >>> turtle.degrees() 
Set the angle measurement units to radians. Example: >>> turtle.radians() 
Clear the screen, recenter the pen, and set variables to the default values. Example: >>> turtle.position() [0.0, 22.0] >>> turtle.heading() 100.0 >>> turtle.reset() >>> turtle.position() [0.0, 0.0] >>> turtle.heading() 0.0 
Clear the screen. The turtle does not move. Example: >>> turtle.clear() 
Set tracing on if flag is True, and off if it is False. Tracing means line are drawn more slowly, with an animation of an arrow along the line. Example: >>> turtle.tracer(False) # turns off Tracer 
Go forward distance steps. Example: >>> turtle.position() [0.0, 0.0] >>> turtle.forward(25) >>> turtle.position() [25.0, 0.0] >>> turtle.forward(75) >>> turtle.position() [50.0, 0.0] 
Go backwards distance steps. The turtle's heading does not change. Example: >>> turtle.position() [0.0, 0.0] >>> turtle.backward(30) >>> turtle.position() [30.0, 0.0] 
Turn left angle units (units are by default degrees, but can be set via the degrees() and radians() functions.) When viewed from above, the turning happens inplace around its front tip. Example: >>> turtle.heading() 22 >>> turtle.left(45) >>> turtle.heading() 67.0 
Turn right angle units (units are by default degrees, but can be set via the degrees() and radians() functions.) When viewed from above, the turning happens inplace around its front tip. Example: >>> turtle.heading() 22 >>> turtle.right(45) >>> turtle.heading() 337.0 
Pull the pen up  no drawing when moving. Example: >>> turtle.up() 
Put the pen down  draw when moving. Example: >>> turtle.down() 
Set the line to thickness to width. Example: >>> turtle.width(10) 
Set the pen color. Three input formats are allowed: color(s) s is a Tk specification string, such as "red" or "yellow" color((r, g, b)) *a tuple* of r, g, and b, which represent, an RGB color, and each of r, g, and b are in the range [0..1] color(r, g, b) r, g, and b represent an RGB color, and each of r, g, and b are in the range [0..1] Example: >>> turtle.color('brown') >>> tup = (0.2, 0.8, 0.55) >>> turtle.color(tup) >>> turtle.color(0, .5, 0) 
Write text at the current pen position. If move is true, the pen is moved to the bottomright corner of the text. By default, move is False. Example: >>> turtle.write('The race is on!') >>> turtle.write('Home = (0, 0)', True) 
Call fill(1) before drawing the shape you want to fill, and fill(0) when done. Example: >>> turtle.fill(1) >>> turtle.forward(100) >>> turtle.left(90) >>> turtle.forward(100) >>> turtle.left(90) >>> turtle.forward(100) >>> turtle.left(90) >>> turtle.forward(100) >>> turtle.fill(0) 
Called just before drawing a shape to be filled. Must eventually be followed by a corresponding end_fill() call. Otherwise it will be ignored. Example: >>> turtle.begin_fill() >>> turtle.forward(100) >>> turtle.left(90) >>> turtle.forward(100) >>> turtle.left(90) >>> turtle.forward(100) >>> turtle.left(90) >>> turtle.forward(100) >>> turtle.end_fill() 
Called after drawing a shape to be filled. Example: >>> turtle.begin_fill() >>> turtle.forward(100) >>> turtle.left(90) >>> turtle.forward(100) >>> turtle.left(90) >>> turtle.forward(100) >>> turtle.left(90) >>> turtle.forward(100) >>> turtle.end_fill() 
Draw a circle with given radius. The center is radius units left of the turtle; extent determines which part of the circle is drawn. If not given, the entire circle is drawn. If extent is not a full circle, one endpoint of the arc is the current pen position. The arc is drawn in a counter clockwise direction if radius is positive, otherwise in a clockwise direction. In the process, the direction of the turtle is changed by the amount of the extent. >>> turtle.circle(50) >>> turtle.circle(120, 180) # half a circle 
Return the turtle's current heading. Example: >>> turtle.heading() 67.0 
Set the turtle facing the given angle. Here are some common directions in degrees: 0  east 90  north 180  west 270  south Example: >>> turtle.setheading(90) >>> turtle.heading() 90 >>> turtle.setheading(128) >>> turtle.heading() 128 
Returns the width of the turtle window. Example: >>> turtle.window_width() 640 
Return the height of the turtle window. Example: >>> turtle.window_height() 768 
Return the current (x, y) location of the turtle. Example: >>> turtle.position() [0.0, 240.0] 
Set the turtle's x coordinate to be xpos. Example: >>> turtle.position() [10.0, 240.0] >>> turtle.setx(10) >>> turtle.position() [10.0, 240.0] 
Set the turtle's y coordinate to be ypos. Example: >>> turtle.position() [0.0, 0.0] >>> turtle.sety(22) >>> turtle.position() [0.0, 22.0] 
Returs the angle, which corresponds to the line from turtleposition to point (x,y). Argument can be two coordinates or one pair of coordinates or a RawPen/Pen instance. Example: >>> turtle.position() [10.0, 10.0] >>> turtle.towards(0,0) 225.0 
Go to the given point. If the pen is down, then a line will be drawn. The turtle's orientation does not change. Two input formats are accepted: goto(x, y) go to point (x, y) goto((x, y)) go to point (x, y) Example: >>> turtle.position() [0.0, 0.0] >>> turtle.goto(50, 45) >>> turtle.position() [50.0, 45.0] 
Set the turtle's speed. speed must one of these five strings: 'fastest' is a 0 ms delay 'fast' is a 5 ms delay 'normal' is a 10 ms delay 'slow' is a 15 ms delay 'slowest' is a 20 ms delay Example: >>> turtle.speed('slow') 
Set the drawing delay in milliseconds. This is intended to allow finer control of the drawing speed than the speed() method Example: >>> turtle.delay(15) 
Trees  Indices  Help 


Generated by Epydoc 3.0.1 on Fri Jun 13 23:39:13 2008  http://epydoc.sourceforge.net 