tkinter the trace () to track changes

from Tkinter Import * DEF the callback (* args): 
    xl.set (xE.get ()) Print ( " changed data: " , xE.get ()) 
the root = Tk () 
root.title ( " Tkinter of trace ( ) change Tracking " ) 
xE = StringVar () 
entry = the entry (the root, textvariable = xE) 
entry.pack (pady =. 5, padx = 10 ) 
xE.trace ( " W " , the callback) #" W "is a parameter write 
XL = StringVar () 
Lab = the Label (the root, textvariable =


    


 XL)
xl.set (" Input Display " ) 
lab.pack (pady =. 5, padx = 10 ) 

root.mainloop ()

 

Guess you like

Origin www.cnblogs.com/zmzzm/p/11973891.html