I need to be able to config the button that is clicked inside a function whilst using the function for multiple buttons
Iv'e seen people use the parameters to call the name of the button in the fucntion, however I've already used the parameters for a necessary part of my code so I am unable to do this
clicked = 0
def click_place(position):
while clicked < 6:
clicked += 1
place_positions.append(position)
.config(bg="yellow") #where I need help
#placement buttons
place_buttons = Frame(window)
place_positions = []
but1 = Button(place_buttons, height = 2, width = 5, command= lambda:click_place('A1'))
but1.grid(row = 0, column = 0)
but2 = Button(place_buttons, height = 2, width = 5, command= lambda:click_place('A2'))
but2.grid(row = 0, column = 2)
place_buttons.place(x=250, y=500, anchor=CENTER)