Skip to content

Commit 908c1fa

Browse files
authored
Digital_Clock_with_python (#66)
1 parent dfc90a2 commit 908c1fa

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Digital_Clock_with_python.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from tkinter import *
2+
from tkinter.ttk import *
3+
4+
from time import strftime
5+
6+
root = Tk()
7+
root.title("Clock")
8+
9+
def time():
10+
string = strftime ('%H:%M:%S %p')
11+
label.config(text=string)
12+
label.after(1000, time)
13+
14+
label = Label(root, font=("ds-digital", 80), background = "black",foreground = "cyan")
15+
label.pack(anchor='center')
16+
time()
17+
18+
mainloop()

0 commit comments

Comments
 (0)