# create buttons button_dict = {} for y_pos in range(7): for x_pos in range(6): def change_player(obj, button): player_select.config(text="Player_2_Turn") p2 = True theButton = "" for key in button: theButton = key button[theButton].config(text=obj) # create the buttons button_dict[y_pos] = Button( frame, text = '', width=16, height=7, bg="Black", command = lambda text = "*", : change_player(text, frame.children), fg="Light Blue", ) button_dict[y_pos].grid(row=x_pos, column=y_pos)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)