The problem is text.
If you give an argument text, it seems like textvariable.get()nothing will return. I do not know if his mistake was or not.
from Tkinter import *
master = Tk()
v = StringVar()
def Entered(p1):
print 'Got: ', Entry1.get()
print 'Got: ', v.get()
Entry1 = Entry(master, width = 25, textvariable = v)
Entry1.pack()
Entry1.bind('<Return>', Entered)
master.mainloop()
If you enter asd, it will return:
Got: asd
Got: asd
The interesting part is that if you change the entry to:
Entry1 = Entry(master, text = 'sajt', width = 25, textvariable = v)
It still will not return anything using v.get()not sajt, as I expected.
source
share