python Generated clock effect , You can refer to :

Used python edition :3.7.0 , Here is the source code :
# time.py from turtle import * from datetime import * import time def
SetupClock(radius): # Create the outer frame of the table reset() pensize() for i in range(60): Skip(radius)
if i % 5 == 0: forward(20) Skip(-radius-20) else: dot(5) Skip(-radius) right(6)
def Skip(step): penup() forward(step) pendown() # Define the table needle function mkHand() def
mkHand(name, length): # register Turtle shape , Set up a watch needle Turtle 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") # Reset Turtle Point north # Set up three watches Turtle And initialize mkHand("secHand", 125)
mkHand("minHand", 130) mkHand("hurHand", 90) secHand = Turtle()
secHand.shape("secHand") minHand = Turtle() minHand.shape("secHand") hurHand =
Turtle() hurHand.shape("secHand") for hand in secHand, minHand, hurHand:
hand.shapesize(1, 1, 3) hand.speed(0) # Create output text Turtle printer = Turtle()
printer.hideturtle() printer.penup() def get_week_day(): week_day_dict = { 0 :
' Monday ', 1 : ' Tuesday ', 2 : ' Wednesday ', 3 : ' Thursday ', 4 : ' Friday ', 5 : ' Saturday ', 6 : ' Sunday ', }
today = int(time.strftime("%w")) return week_day_dict[today] # Update clock function Tick() def
Tick(): # The dynamic display of drawing needle t = datetime.today() second = t.second +
t.microsecond*0.000001 minute = t.minute + second/60.0 hour = t.hour +
minute/60.0 tracer(False) printer.forward(65) # print(get_week_day())
printer.write(get_week_day(), align="center", font=("Courier", 14, "bold"))
printer.back(130) printer.write((str(t.year)+"-"+str(t.month)+"-"+str(t.day)),
align="center", font=("Courier", 14, "bold")) printer.home() tracer(True)
secHand.setheading(6*second) minHand.setheading(6*minute)
hurHand.setheading(30*hour) ontimer(Tick, 100) #100ms Continue calling after tick def main():
tracer(False) Init() SetupClock(160) tracer(True) Tick() mainloop() if __name__
== '__main__': main()
 

Technology
©2019-2020 Toolsou All rights reserved,
Huawei Mate 40 Pro+ 5G exposure : Leica film lens , Ceramic body ( Essence )2020 year 6 month 26 day C# Class library Exception handling help class org.postgresql.util.PSQLException Processing records mysql Modify primary key [RK3399][Android7.1] Learning notes DRM Driver development ( introduce )SSM Project's excel File upload and add to database element-ui+vue-treeselect Verification of drop down box vue vue-element-admin Summary of the project element ui Drop down box search function C#/.NET System optimization (redis Chapter 6 data structure 【List】)