How to make CLOCK with Python 🐢 (Is it working???)

Опубликовано: 25 Июль 2026
на канале: NR tech knowledge
1,457
64

How to make CLOCK with Python 🐢 (Is it working???) #coding #viral #turtle #python #shots

#shorts, #live, #youtube, #funnyshorts, #memes, #alpha, #newvideo, #tiktok, #gameplay, #explore, #subscribe, #sub, #youtubeguru, #youtubeislife, #shortsfunny, #shortsbgm, #shortstiktok, #shortscomedy, #shortsbts, #shortsasmr, #shortsadoptme, #shortsanity, #shortsbeta, #shortsart, #shortscooking, #shortschallenge, #youtuberlikes

•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
SOURCE CODE:-
import turtle
#import time
import datetime

t = turtle.Turtle()
screen = turtle.Screen()
screen.colormode(255)
screen.bgpic('clock_dial_1.png')
t.speed(0)
smooth_move = True

def digital():
screen.tracer(0)
c = datetime.datetime.now()
micro_sec_raw = (c.strftime('%f'))
micro_sec = int(f"{micro_sec_raw[0]}{micro_sec_raw[1]}")
sec = int(c.strftime('%S'))
min = int(c.strftime('%M'))
hour = int(c.strftime('%I'))
arg = f"{hour} : {min} : {sec}.{micro_sec}"
t.up()
t.goto(10,-600)
t.write(arg, move=False, align='center', font=('italic', 20, 'normal'))

def center_circle():
t.home()
t.up()
t.goto(0,-12)
t.down()
t.color(0,0,255)
t.width(6)
t.begin_fill()
t.fillcolor(255,0,0)
t.circle(12,360,50)
t.end_fill()

def clock_hands():
screen.tracer(0)
t.hideturtle()

c = datetime.datetime.now()

micro_sec_raw = (c.strftime('%f'))
micro_sec = int(f"{micro_sec_raw[0]}{micro_sec_raw[1]}")
sec = int(c.strftime('%S')) * 6
min = int(c.strftime('%M')) * 6
hour = int(c.strftime('%I')) * 30

t.home()
t.seth(-hour + 90 - min / 12)
t.width(12)
t.color(0,0,255)
t.fd(170)

t.home()
t.seth(-min + 90 - sec / 60 )
t.width(12)
t.color(0,0,255)
t.fd(260)

if smooth_move == True:
t.home()
t.seth(-sec + 90 - micro_sec / 16)
t.width(5)
t.pencolor(255,0,0)
t.fd(260)

elif smooth_move == False:
t.home()
t.seth(-sec + 90)
t.width(5)
t.pencolor(255,0,0)
t.fd(260)

while True:
#start = time.time()
clock_hands()
center_circle()
digital()
screen.update()
#time.sleep(1 - (time'.time() - start))
t.reset()

screen.mainloop()

•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••

LIKE👍
SHARE🧑‍🤝‍🧑
SUBSCRIBE ✨✨✨✨✨