Skip to content

Commit 7fbeac2

Browse files
authored
Digital Clock
1 parent 501115e commit 7fbeac2

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

DigitalClock/Capture.PNG

7.46 KB
Loading

DigitalClock/clock.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from tkinter import *
2+
import time
3+
4+
root = Tk()
5+
root.title('My Clock')
6+
7+
def counttime(time1=''):
8+
time2 = time.strftime('%H:%M:%S')
9+
if time2 != time1:
10+
time1 = time2
11+
clock.config(text=time2)
12+
clock.after(200, counttime)
13+
14+
clock = Label(root, font=('Poppins', 50, 'bold'), background='blue', foreground='white')
15+
clock.pack(anchor='center')
16+
17+
counttime()
18+
mainloop()

0 commit comments

Comments
 (0)