for i, row in enumerate(board):
    for j, column in enumerate(row):
        L = tk.Label(root, text='    ', bg='grey')
L.grid(row=i, column=j)
L.bind('<Button-1>', lambda e, i=i, j=j: on_click(i, j, e))
root.mainloop()
Creating a game board with Python and Tkinter