##初始化turtle:
printer = turtle.Turtle() 或者 printer = turtle.Pen()

weekday:

返回某天是一个星期的第几天

t = datetime.today()

def Week(t):
week = ["星期一", "星期二", "星期三",
             "星期四", "星期五", "星期六", "星期日"]
return week[t.weekday()]

 

turtle.write

write(arg,move=false,align='left',font=('arial',8,'normal'))
在当前乌龟位置写入文本。

arg--信息,将写入Turtle绘画屏幕。

move(可选)--真/假。

align(可选)--字符串“左(left)”、“中(center)”或“右(right)”之一。

font(可选)--三个字体(fontname、fontsize、fonttype)。

写入文本 - arg的字符串表示形式 - 当前

根据“对齐”(“左”、“中”或“右”)定位乌龟以及给定的字体。

如果move为true,则笔将移动到右下角。

在默认情况下,move为false。

turtle.shape(name=None),返回或设置形状,最初有以下形状:“arrow”, “turtle”, “circle”, “square”, “triangle”, “classic”

turtle.shapesize(stretch_wid=Nonestretch_len=Noneoutline=None)

stretch_wid是垂直方向拉伸,stretch_len水平方向拉伸,outline轮廓的宽度

turtle.tracer()

turtle.tracer()是为了加快作图的,你可以在里面添加参数,比如:
turtle.tracer(False)或者turtle.tracer(0):图形将一次性画好
turtle.tracer(1):图形按照正常速度进行,可有可无
turtle.tracer(4):在循环中,图形将一次画出4次循环的图

turtle.ontimer( )

调用turtle.ontimer( )函数进入循环调用,100ms后继续调用tick函数, turtle.ontimer(Tick, 100)

原博:https://blog.csdn.net/zengxiantao1994/article/details/76588580#

posted on 2020-07-27 17:39  Hui_101  阅读(303)  评论(0编辑  收藏  举报