Im making a game using tkinter and I need it to be when the tkinter button in pressed then the name of the button changes to an "x" then an "o" then a blank string again.
im making the grid of buttons using for loops:
class Grid(Tk.Frame):
def __init__(self, win):
Tk.Frame.__init__(self, win)
for row in range(3):
for col in range(3):
butt1 = Tk.Button(self, bg='blue', width=round(WIDTH/33), height=round(HEIGHT/66), command=)
butt1.grid(row=row, column=col)
grid = Grid(win)
grid.pack(side="top", fill="both", expand=True)
Though im not sure what command to put in the button because if i make a function that makes butt1["text"] = "x"
then it will only work for the last button because each button has the same varable name.
Im trying to make it so the variable name is changed independently of the button name.