Skip to content

Instantly share code, notes, and snippets.

@naazeri
Last active March 31, 2023 09:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naazeri/b41d8aefcb2270b12eb9bc0574b231f8 to your computer and use it in GitHub Desktop.
Save naazeri/b41d8aefcb2270b12eb9bc0574b231f8 to your computer and use it in GitHub Desktop.
from tkinter import *
from tkinter.ttk import *
from time import strftime
# creating window
window = Tk()
window.title('Clock')
# create label
lbl = Label(window, font=('calibri', 50, 'bold'),
background='black',
foreground='green1')
lbl.pack()
def displayTime():
time = strftime('%H:%M:%S %p')
lbl.config(text=time)
lbl.after(1000, displayTime)
displayTime()
mainloop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment