# #初始化turtle:
t = Turtle. Turtle () or t = Turtle. Pen ()
# #查询turtle状态
#位置
T.position ()
#箭头朝向, the arrows are oriented clockwise or counterclockwise, depending on the value of Turtle.mode () clockwise or counterclockwise, the default turtle.mode () = Standard, which indicates a counterclockwise direction; logo indicates clockwise
T.heading ()
#初始状态下箭头向右转20度, t.heading () = 340
T.right (20)
T.left (20)
#向前或向后
T.forward (10)
T.backward (10)
#设置turtle位置
T.goto (x, y) = T.setpos (x, y) = T.setposition (x, y)
T.setx (x)
T.sety (y)
#设置turtle方向, specific direction and Turtle.mode, default standard, set to 90 degrees, arrow pointing to True North
T.setheading (90)
#turtle回到初始位置和初始方向
T.home ()
#画圆, the first parameter is a radius, the radius is positive, the default circle is drawn counterclockwise, the radius is negative, and the circle is drawn clockwise.
#t. Circle ( -20,90), clockwise, Radius 20 arc, Radian 90
#t. Circle (20,90,10), the third parameter specifies a total of a few steps to finish, equivalent to a polygon
T.circle (20)
Pythong Module Turtle Simple usage