#print("Tuzuvchi Latipov Odilbek")
from turtle import*
import time
time.time()
t = Turtle()
wn = Screen()
wn.title('Soat')
wn.bgcolor('black')
wn.setup(6000,6000)
t.speed(1)
t.pensize(3)
t.hideturtle()
wn.tracer(0)

def draw_clock(h,m,s,t):
    t.penup()
    t.goto(0,210)
    t.setheading(180)
    t.pencolor("green")
    t.pendown()
    t.circle(210)
    # soatni vaqtini belgilaymiz
    t.penup()
    t.goto(0,0) #markaz
    t.setheading(90)
    for _ in range(12):
        t.forward(190)
        t.pendown()
        t.fd(20)
        t.penup()
        t.goto(0,0)
        t.right(30)

    # soatni minut va sek belgilaymiz
    t.penup()
    t.goto(0, 0)  # markaz
    t.setheading(90)
    for _ in range(60):
        t.forward(200)
        t.pendown()
        t.fd(10)
        t.penup()
        t.goto(0, 0)
        t.right(6)
    # soatni dizayni
    # 1 raqami

    t.penup()
    t.goto(0,0)
    t.setheading(60)
    t.fd(145)
    t.setheading(0)
    t.fd(15)
    t.write(1,move=False,align ="center",font = ("arial", 25,"normal" ))


    #2 raqami

    t.penup()
    t.goto(0,0)
    t.setheading(30)
    t.fd(135)
    t.setheading(0)
    t.fd(35)
    t.write(2, move=False, align="center", font=("arial", 25, "normal"))

    # 3 raqami

    t.penup()
    t.goto(0, 0)
    t.setheading(352)
    t.fd(150)
    t.setheading(0)
    t.fd(25)
    t.write(3, move=False, align="center", font=("arial", 25, "normal"))

    #  4 raqami

    t.penup()
    t.goto(0, 0)
    t.setheading(315)
    t.fd(150)
    t.setheading(0)
    t.fd(45)
    t.write(4, move=False, align="center", font=("arial", 25, "normal"))

    # 5 raqami

    t.penup()
    t.goto(0, 0)
    t.setheading(290)
    t.fd(178)
    t.setheading(0)
    t.fd(25)
    t.write(5, move=False, align="center", font=("arial", 25, "normal"))

    # 6 raqami

    t.penup()
    t.goto(0, 0)
    t.setheading(270)
    t.fd(190)
    t.write(6, move=False, align="center", font=("arial", 25, "normal"))

    # 7 raqami

    t.penup()
    t.goto(0, 0)
    t.setheading(258)
    t.fd(170)
    t.setheading(180)
    t.fd(48)
    t.write(7, move=False, align="center", font=("arial", 25, "normal"))

    # 8 raqami

    t.penup()
    t.goto(0, 0)
    t.setheading(228)
    t.fd(150)
    t.setheading(180)
    t.fd(45)
    t.write(8, move=False, align="center", font=("arial", 25, "normal"))

    # 9 raqami

    t.penup()
    t.goto(0, 0)
    t.setheading(188)
    t.fd(150)
    t.setheading(180)
    t.fd(25)
    t.write(9, move=False, align="center", font=("arial", 25, "normal"))

    # 10 raqami

    t.penup()
    t.goto(0, 0)
    t.setheading(150)
    t.fd(135)
    t.setheading(180)
    t.fd(25)
    t.write(10, move=False, align="center", font=("arial", 25, "normal"))

    # 11 raqami

    t.penup()
    t.goto(0, 0)
    t.setheading(120)
    t.fd(145)
    t.setheading(180)
    t.fd(15)
    t.write(11, move=False, align="center", font=("arial", 25, "normal"))

    # 12 raqami

    t.penup()
    t.goto(0, 0)
    t.setheading(90)
    t.fd(150)
    t.write(12, move=False, align="center", font=("arial", 25, "normal"))

    #Soat millari
    t.pu()
    t.goto(0,0)
    t.pencolor("red")
    t.setheading(90)
    angle =(h/12)*360
    t.rt(angle)
    t.pendown()
    t.fd(80)

    # minut millari
    t.pu()
    t.goto(0, 0)
    t.pencolor("blue")
    t.setheading(90)
    angle = (m / 60) * 360
    t.rt(angle)
    t.pendown()
    t.fd(120)

    # sekund millari
    t.pu()
    t.goto(0, 0)
    t.pencolor("white")
    t.setheading(90)
    angle = (s / 60) * 360
    t.rt(angle)
    t.pendown()
    t.fd(160)

while True:
    h=int(time.strftime("%I"))
    m = int(time.strftime("%M"))
    s = int(time.strftime("%S"))
    draw_clock(h, m, s, t)
    wn.update()
    time.sleep(1)
    t.clear()
mainloop()