I'm trying to change the value of the text of a label in tkinter, I'm using label.config() but it seems that the previous value still appears on the screen with the new value.
This is the code that I'm using:

This is the result, the previous and the new text are together:

Whenever select_description() is executed, new label is created and put in same cell. That is why there are overlapped text.
You need to create the label once outside the function:
description_label = Label(frame1)
description_label.grid(row=4, column=0, columnspan=4)
def select_description(event):
choice = list_profiles.get(ANCHOR)
if choice == 1:
description_label.config(text=...)
elif choice == 2:
description_label.config(text=...)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With