Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add comments to code for readability
  • Loading branch information
ozdyck3 committed May 31, 2021
commit 1e44a3d852b2b6f2e2accfee34aed78ce2cf64f2
6 changes: 6 additions & 0 deletions DigitalClock/clock.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
# import GUI library - Tkinter
from tkinter import *
import time

root = Tk()

# Title the window to "My Clock"
root.title('My Clock')

#Time calculation
def counttime(time1=''):
time2 = time.strftime('%H:%M:%S')
if time2 != time1:
time1 = time2
clock.config(text=time2)
clock.after(200, counttime)

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

# Clock loop
counttime()
mainloop()