Skip to content

Commit fd8c19f

Browse files
Create graphical clock.py
1 parent 50ed572 commit fd8c19f

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

graphical clock.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from tkinter import *
2+
from tkinter.ttk import *
3+
4+
from time import strftime
5+
6+
tk = Tk()
7+
tk.title('Clock')
8+
9+
def time():
10+
string = strftime('%A %D %H:%M:%S: %p')
11+
label.config(text=string)
12+
label.after(1000, time)
13+
14+
15+
label = Label(tk, font=('Comic Sans MS', 40, 'bold'),
16+
background='black',
17+
foreground='green')
18+
19+
label.pack(anchor='s')
20+
time()
21+
22+
mainloop()

0 commit comments

Comments
 (0)