Feb-22-2021, 10:54 PM
One way to go about it would be to put all of those labels into a list like so:
from tkinter import * window = Tk() data = [['100%', '80%', '60%', '40%', '20%', '10%'], ['100%', '90%', '55%', '30%', '10%', '0%']] labels = [] for x in range (6) : labels.append (Label(window, text="...")) labels [x].grid () def recall1(): for x in range (6) : labels [x].configure(text=data[0][x]) def recall2(): for x in range (6) : if x == 0 : y = 0 else : y = 1 labels [x].configure(text=data[y][x]) recallButton1 = Button(window, text="Recall Scene 1", padx=50, command=recall1) recallButton2 = Button(window, text="Recall Scene 2", padx=50, command=recall2) recallButton1.grid() recallButton2.grid() window.mainloop()