I am trying to get the content of "Entry" from Tkinter and use it as an argument for another script to execute. The function get() does not seem to work:
import Tkinter
master = Tkinter.Tk()
master.geometry('200x100')
def callback():
#execfile("Hello.py")
print e1.get()
L1 = Tkinter.Label(master, text="Files").grid(row=1)
L2 = Tkinter.Label(master, text="Dice score").grid(row=2)
e1 = Tkinter.Entry(master, bg="white").grid(row=1, column=1)
e2 = Tkinter.Entry(master, bg ="white").grid(row=2, column=1)
B = Tkinter.Button(master, text="Start script", command = callback).grid(row=0, column=0)
master.mainloop()
When I execute this script and press the button instead of printing what's in e1 entry I get:
print e1.get()
AttributeError: 'NoneType' object has no attribute 'get'