-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
55 lines (25 loc) · 834 Bytes
/
main.py
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
from tkinter import *
import time
root = Tk()
root.geometry("250x200")
def quit():
root.quit()
def clock():
hour = time.strftime("%I")
minute = time.strftime("%M")
seconds = time.strftime("%S")
my_clock.config(text=hour + ":" + minute + ":" + seconds)
def ticking():
my_clock.after(1000,clock)
start.after(1000, ticking)
explaination = Label(root, text='Alarm Clock', fg="grey")
explaination.grid(row=2,column=15,columnspan=1)
start = Button(text='START', width=5,height=3, command=ticking)
start.grid(row=4, column=17,columnspan=2)
stop = Button(text='STOP',width=5, height=3,command=quit)
stop.grid(row=4,column=2)
my_clock = Label(root, text="")
my_clock.grid(row=4, column=14, columnspan=3)
# ticking()
root.title('Alarm Clock')
root.mainloop()