0
Hello I got error in coading by creating clock please anyone solve this code please 🥺 code in discrimination
form tkinter import form tkinter.ttk import form time import strftime root=tk() root.title("clock") def time(): string = strftime('%H:%M:%S:%P') lable.config(text=string) lable.after(1000,time) lable=lable(root,font=("mmsdigitalclock ",80),background = "black",foreground = "cyan") lable.pack(anchor='center') time() mainloop()
3 Réponses
+ 1
ttk was not used. import only if needed.
Label not lable
0
from tkinter import Tk, Label, mainloop
from time import strftime
root=Tk()
root.title("clock")
def time():
string = strftime('%H:%M:%S:%P')
lable.config(text=string)
lable.after(1000,time)
lable=Label(root,font=("mmsdigitalclock ",20),background = "black",foreground = "cyan")
lable.pack(anchor='center')
time()
mainloop()