Thanks.
I created a list of buttons as you suggested.
What is the correct syntax that I need to use?
.
Answering my own question.
I did not need
I created a list of buttons as you suggested.
buttons = []then I add each button to that list
buttons.append(aButton)But,
buttons[i]['bg'] = 'red'does not work.
What is the correct syntax that I need to use?
.
Answering my own question.
I did not need
aButton = "button" + str(i).
for i in range(1, 3): aButton = tkinter.Button(Gui, font=Font1, text=i, image=myPixel, width=70, height=70, compound="c", bg='white', activebackground='white') buttons.append(aButton) aButton['command'] = partial(setBG, aButton) aButton.grid(row=1, column=i)and add
buttons[i].config(background="red")