from Tkinter import *
def callback1(e2):
c = e2.get()[0:9]
print "c=" , c
e2.set(c)
top=Tk()
e2=StringVar()
entry2=Entry(top,textvariable=e2)
e2.trace("w", lambda name, index, mode, e2=e2: callback1(e2))
entry2.pack()
top.mainloop()
from Tkinter import *
def callback1(e2):
c = e2.get()[0:9]
print "c=" , c
e2.set(c)
top=Tk()
e2=StringVar()
entry2=Entry(top,textvariable=e2)
e2.trace("w", lambda name, index, mode, e2=e2: callback1(e2))
entry2.pack()
top.mainloop()