Skip to content

Commit 1e44a3d

Browse files
committed
Add comments to code for readability
1 parent 6b804ca commit 1e44a3d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

DigitalClock/clock.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
1+
# import GUI library - Tkinter
12
from tkinter import *
23
import time
34

45
root = Tk()
6+
7+
# Title the window to "My Clock"
58
root.title('My Clock')
69

10+
#Time calculation
711
def counttime(time1=''):
812
time2 = time.strftime('%H:%M:%S')
913
if time2 != time1:
1014
time1 = time2
1115
clock.config(text=time2)
1216
clock.after(200, counttime)
1317

18+
# Create the clock text
1419
clock = Label(root, font=('Poppins', 50, 'bold'), background='blue', foreground='white')
1520
clock.pack(anchor='center')
1621

22+
# Clock loop
1723
counttime()
1824
mainloop()

0 commit comments

Comments
 (0)