import time
import turtle
def getTime():
tt = time.localtime() # 结构化的时间
ss = time.strftime('%Y年%m月%d日 %H:%M:%S', tt)
return ss
pen = turtle.Turtle()
pen.backward(100)
pen.speed(0)
while True:
time.sleep(1)
times = getTime()
pen.clear()
pen.write(times, font=("Arial", 40, "normal"))
input()
效果