Created
January 8, 2021 19:24
-
-
Save JayantGoel001/b70118b184aa168f8fd266c664eb42b0 to your computer and use it in GitHub Desktop.
Creating A Digital Clock using tkinter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tkinter import * | |
from time import strftime | |
def clock(): | |
current_time = strftime('%H:%M:%S %p') | |
label.config(text=current_time) | |
label.after(1000, clock) | |
win = Tk() | |
win.title("Digital Clock") | |
label = Label(win, font=('sans', 80), background='black', foreground='white') | |
label.pack(anchor='center') | |
clock() | |
win.mainloop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment