When'People .config' runs it only changes the bottom right button, is there any way to change it so that whichever button in my grid is clicked changes colour.
def click(row, col):
label.configure(text="you booked row %s column %s" % (row, col), bg='black', fg='yellow', font='Times
22')
print("you booked row %s column %s" % (row, col))
People.config(bg='red')
root.configure(bg="black")
Seats = Frame(root, height=100, width =200, bg = 'black')
Seats.grid(row=0, column = 1)
for row in range(10):
for col in range(20):
People = Button(Seats, bg='Orange',text="%s,%s" % (row, col),
command=lambda row=row, col=col: click(row, col))
People.grid(row=row, column=col+1, pady=1,padx=1)