0

I keep getting ulabel does not have the attribute 'get', please help me

# I keep getting ulabel has no attribute 'get', what do i do please? from tkinter import * from tkinter import ttk ws = Tk() ws.title('Entry test') def good(): user = ulabel.get() return Label(we, text = 'Okay' + user).grid(row = 3, column = 3) def welcome(): name = nameTf.get() return Label(ws, text = f'Hello {name}').grid(row = 2, column = 3) L1 = Label(ws, text = 'Enter Name').grid(row = 0, column = 0) nameTf = Entry(ws, bd = 8).grid(row = 0, column = 1) B1 = Button(ws, text = 'Submit', command = welcome).grid(row = 1, columnspan = 2) ulabel = Entry(ws, bd = 7).grid(row = 0, column = 2) B2 = Button(ws, text = 'Okay', command = good).grid(row = 3, column = 3) ws.mainloop()

18th Apr 2022, 7:28 PM
David Michael
David Michael - avatar
4 Réponses
+ 2
Yeah, cause it don't. Set up a Stringvar as the text inside the label. Then you can change it with get() set() methods easy
18th Apr 2022, 7:45 PM
Slick
Slick - avatar
+ 2
18th Apr 2022, 7:54 PM
Slick
Slick - avatar
0
What are you trying to do ulabel if exist are you trying to change the label on command good click
18th Apr 2022, 7:44 PM
Ion Kare
Ion Kare - avatar
0
Slick please can you help me with the syntax, I don't really get it
18th Apr 2022, 7:51 PM
David Michael
David Michael - avatar