-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPythonClock.py
More file actions
63 lines (46 loc) · 1.98 KB
/
PythonClock.py
File metadata and controls
63 lines (46 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
from tkinter import *
import time
from babel.numbers import *
from babel.dates import *
ck = Tk()
ck.title("Digital Clock")
ck.geometry("1200x600")
ck.maxsize(1200, 600)
ck.minsize(1200, 600)
ck.config(bg='#0000ff')
ck.iconbitmap("Apparky.ico")
def clock():
h = str(time.strftime("%H"))
m = str(time.strftime("%M"))
s = str(time.strftime("%S"))
# print(h, m, s)
if int(h) > 11 and int(m) > 0:
lbl_n.config(text="PM")
if int(h) > 12:
h = str(int(int(h) - 12))
lbl_h.config(text=h)
lbl_m.config(text=m)
lbl_s.config(text=s)
lbl_h.after(500, clock)
lbl_h = Label(ck, text="12", font=("Times New Roman ", 55, 'bold'), bg="white", fg='black')
lbl_h.place(x=300, y=200, width=135, height=90)
lbl_h_t = Label(ck, text="HOUR", font=("Times New Roman ", 20, 'bold'), bg="white", fg='black')
lbl_h_t.place(x=300, y=320, width=135, height=60)
lbl_m = Label(ck, text="00", font=("Times New Roman ", 55, 'bold'), bg="white", fg='black')
lbl_m.place(x=450, y=200, width=135, height=90)
lbl_m_t = Label(ck, text="MINUITES", font=("Times New Roman ", 20, 'bold'), bg="white", fg='black')
lbl_m_t.place(x=450, y=320, width=135, height=60)
lbl_s = Label(ck, text="12", font=("Times New Roman ", 55, 'bold'), bg="white", fg='black')
lbl_s.place(x=600, y=200, width=135, height=90)
lbl_s_t = Label(ck, text="SECONDS", font=("Times New Roman ", 20, 'bold'), bg="white", fg='black')
lbl_s_t.place(x=600, y=320, width=135, height=60)
lbl_n = Label(ck, text="A.M", font=("Times New Roman ", 55, 'bold'), bg="white", fg='black')
lbl_n.place(x=750, y=200, width=135, height=90)
lbl_n_t = Label(ck, text="AM/PM", font=("Times New Roman ", 20, 'bold'), bg="white", fg='black')
lbl_n_t.place(x=750, y=320, width=135, height=60)
name_label = Label(ck, text="Powered by Apparky", font=("Times New Roman ", 20, 'bold'), bg="blue")
name_label.pack()
exit_button = Button(ck, text="Exit", command=ck.destroy, bg="blue")
exit_button.pack(anchor=SE, side=BOTTOM)
clock()
ck.mainloop()