from tkinter import *
root=Tk()
root.title("TKINTER WINDOW")
root.geometry("300x300")
root.resizable(width="false",height="false")
entry=Entry(root).place(x=50,y=0)
def get_name():
print(entry.get())
label=Label(root,text="Name: ").place(x=0,y=0)
btn=Button(root,text="click me",command= lambda : get_name()).place(x=100,y=100)
root.mainloop()
I'm trying to get the value of entry but getting this error.I'm new to python...stackoverflow keeps telling me to add more lines or it won't post my question but i have nothing else to say.
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\Manish Gusain\AppData\Local\Programs\Python\Python37-32\lib\tkinter\__init__.py", line 1705, in __call__
return self.func(*args)
File "C:/Users/Manish Gusain/PycharmProjects/untitled/practice.py", line 15, in <lambda>
btn=Button(root,text="click me",command= lambda : get_name()).place(x=100,y=100)
File "C:/Users/Manish Gusain/PycharmProjects/untitled/practice.py", line 11, in get_name
print(entry.get())
AttributeError: 'NoneType' object has no attribute 'get'
Process finished with exit code 0```