Home > other >  Python form tkinter using time. Sleep () method for obtaining the system time when jammed, other con
Python form tkinter using time. Sleep () method for obtaining the system time when jammed, other con

Time:05-24

The import tkinter
Root=tkinter. Tk ()
Root. Title (' Pyton form of Liu Mengqiu ')
Root. Geometry (' 800 x600)

The import time
While True:
H: timestr=time. Strftime (" % % M: % S ")
Lb1=tkinter. Label (root, text=timestr, fg='blue', the font=(" black ", 15))
Lb1. Place (relx=0.8, rely=0)
Time. Sleep (1)
Root. Update_idletasks ()
Lb1. Pack_forget ()

root.mainloop()
  • Related