引入方式
>>>impport turtle
>>>from turtle import *
控制画笔绘制状态的函数
pendown() | pd() | down()
penup() | pu() | up()
pensize(wid)| width(wid)
控制画笔颜色和字体函数
color() reset()
begin_fill() end_fill()
filling() clear()
screensize()
showturtle() | st()
hideturtle() | ht()
isvisible()
write(arg,move=False,align="left",font=("Arial",8,"normal"))
控制画笔运动的函数
forward(distance) | fd(distance)
backward(distance) | bk(distance) | back(distance)
right(angle) | rt(angle)
left(angle) | lt(angle)
setheading(to_angle)
position() | pos()
goto(x,y)
setposition(x,y) |setpos(x,y)
circlr(radius,extent,steps)
dot(size, *color)
randians()
stamp()
speed(speed)
clearstamp(stamp_id)
clearstamps(n)
undo()
heading()
towards(x,y) distance(x,y)
xcor() ycor()
setx(x) sety(y)
home()
degrees(fullcircle=360.0)
TurtleScreen/Screen类的函数
bgcolor(*args) getcanvas()
bgpic(picname) getshapes()
clearscreen() turtles()
resetscreen() window_height()
screensize(cwid,canvh,bg) window_width()
tracer(n,delay) bye()
listen(xdummy,ydummy) exitonclick()
onkey(fun,key) title(titlestring)
onkeyrelease(fun,key) setup(wid=_CFG["wid"],h=_CFG["h"],
onkeypress(fun,key) startx=_CFG["leftright"]
onscreeclick(fun,btn=1,add) starty=_CFG["topbottom"])