Skip to content Skip to sidebar Skip to footer

Python: Error In Getting Tkinter's Entry Value With Button

Well since this is my first day learning Python I hope people don't mind for newbie question I have a Tkinter with GUI layout like this: Label(base, text='Site URL: ',width=15).gri

Solution 1:

Try doing something like this:

entry1=Entry(base, width=40)
entry1.grid(row=0,column=1,sticky=STICKY,pady=5)

The problem is you are using a variable whose value is None & when you do None.get(), you get an error. Its value is None because entry1 has the value of the last function called,which was grid() which always returns None.

Edit:

The automatic calling of function is because you are calling it. If you want to send some arguments to a function, do this:

command=lambda:myfunc(myargs)

Also, if you don't want to send any arguments the simple command=myfunc would suffice(Notice that there are no parenthesis here)

Post a Comment for "Python: Error In Getting Tkinter's Entry Value With Button"