今天闲的没事,正好快过年了,编了一个时钟代码,其实并不难,这个会绑定你电脑的时间,然后以钟表的形式显示时间,接下来。
源代码展示: (纯属猿创)
from turtle import *
from datetime import *
def Skip(step):
penup()
forward(step)
pendown()
def mkHand(name,length):
reset()
Skip(-length*0.1)
begin_poly()
forward(length*1.1)
end_poly()
handForm = get_poly()
register_shape(name,handForm)
def Init():
global secHand,minHand,hurHand,printer
mode("logo")
mkHand("secHand",125)
mkHand("minHand",130)
mkHand("hurHand",90)
secHand = Turtle()
secHand.shape("secHand")
minHand = Turtle()
minHand.shape("minHand")
hurHand = Turtle()
hurHand.shape("hurHand")
for hand in secH