app.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
from tkinter import * from tkinter.ttk import * from time import strftime root = Tk() root.title('Clock') def time(): string = strftime('%H:%M:%S %p') lbl.config(text=string) lbl.after(1000, time) lbl = Label(root, font=('calibri', 40, 'bold'), background='purple', foreground='white') lbl.pack(anchor='center') time() mainloop() |