1from tkinter import *
2
3root = Tk()
4sv = StringVar()
5
6def callback():
7 print(sv.get())
8 return True
9
10e = Entry(root, textvariable=sv, validate="focusout", validatecommand=callback)
11e.grid()
12e = Entry(root)
13e.grid()
14root.mainloop()
1from Tkinter import *
2
3def callback(sv):
4 print sv.get()
5
6root = Tk()
7sv = StringVar()
8sv.trace("w", lambda name, index, mode, sv=sv: callback(sv))
9e = Entry(root, textvariable=sv)
10e.pack()
11root.mainloop()