Updating labels each time function is called (Tkinter)
So I'm trying to make it so that my labels update every time my button is clicked, but the text stays the same. It works for the first button click, but it doesn't update each time afterwards.
for x in range(24):
print(ret_val[x])
new_L = Label(root, text=ret_val[x] + "\n")
new_L.pack()
I'm looping through a fixed-size list and trying to display the contents of the list each time around.
Posted May 12, 2022, 9:09 PM UTC
14
First, make 24 blank Labels and store them in a list in your setup section somewhere.
Then, in your function, update each label with the appropriate text: