I have an entry named "Username".
username = Entry()
username.place(x = 10, y = 50)
and a submit button
submit = Button(text="Submit", command=getInfo)
submit.place(x = 150, y = 48)
It calls a getInfo function
def getInfo():
user = username.get()
I'd like to place user as a label. I can print it just fine, the text shows up in the console. When I try to place, I get an error.
File "tk.py", line 8, in getInfo
user.place(x = 150, y = 90)
AttributeError: 'str' object has no attribute 'place'
As the error message says: user
is a string. You know it's a string, because you got it from an Entry
widget using get()
, which returns a string. You need to make a new widget to hold this string, and place that.