I am trying to create a tic-tac-toe game where a 3x3 grid, or matrix contains clickable buttons. when a button object is pressed, I want the button replaced with a image of an X or an O. this is what I have so far. Any help would be great.

```
from tkinter import *

def setX(canvas) :
    x = PhotoImage(file = 'E:\X.png')
    #what to do here to replace button on grid with X or O image?

def create_grid(event=None):
    w = c.winfo_width() # Get current width of canvas
    h = c.winfo_height() # Get current height of canvas
    c.delete('grid_line') # Will only remove the grid_line

    # Creates all vertical lines at intevals of 100
    for i in range(0, w, 200):
        c.create_line([(i, 0), (i, h)], tag='grid_line')

    # Creates all horizontal lines at intevals of 100
    for i in range(0, h, 200):
        c.create_line([(0, i), (w, i)], tag='grid_line')

root = Tk()     
c = Canvas(root, height=600, width=600, bg='white')
c.pack(fill=BOTH, expand=True)

c.bind('<Configure>', create_grid)

b = []
for _ in range(9):
    b.append(Button(c, text="Click", width=10))

b[0].place(x = 60, y = 70)
b[1].place(x = 265, y = 70)
b[2].place(x = 455, y = 70)
b[3].place(x = 60, y = 275)
b[4].place(x = 265, y = 275)
b[5].place(x = 455, y = 275)
b[6].place(x = 60, y = 475)
b[7].place(x = 265, y = 475)
b[8].place(x = 455, y = 475)

root.resizable(width=False, height=False)
root.mainloop()

```