I'm in the early stages of creating a memory game. What I would like is to be able to tell which button has been pressed, but I have no idea how to do this. For example, upon clicking a button, the text changes to something else.
from tkinter import *
import random
root = Tk()
root.title("Memory Game")
buttons=[]#Stores the buttons
counter=0
x=0
y=0
for l in range(0,6):#Creates a grid of 36 working buttons and stores them in "buttons"
x=0
y+=1
for i in range(0,6):
buttons.append(Button(root,text="???"))
buttons[counter].grid(column = x, row = y)
counter+=1
x+=1