I have this code using a .get()
function to retrieve the input from a Tkinter Entry:
from Tkinter import *
def access():
access_window = Toplevel(root)
access_window.title("Access a Contact")
Label(access_window, text="Enter a first name: ").grid(row=0, sticky=W+E)
access_key = Entry(access_window, width=8)
access_key.grid(row=1, sticky=W+E)
Button(access_window, text="Submit", command=lambda: get_info(str(access_key.get("1.0", "end")))).grid(row=2, sticky=W+E)
But when I click the button, I get this error:
Exception in Tkinter callback
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py", line 1470, in __call__
return self.func(*args)
File "/Users/stephenhjb/Documents/First tkinter", line 17, in <lambda>
Button(access_window, text="Submit", command=lambda: get_info(str(access_key.get("1.0", "end")))).grid(row=2, sticky=W+E)
TypeError: get() takes exactly 1 argument (3 given)
Why is this happening?