I have a list of buttons and when I run a function I need to check what button in that list was pressed.
import tkinter
root = tkinter.Tk()
def Function(event):
print('The pressed button is:')
listOfButtons = []
Button = tkinter.Button(root, text="Button 1")
listOfButtons.append(Button)
Button.pack()
Button.bind("<Button-1>", Function)
Button = tkinter.Button(root, text="Button 2")
Button.pack()
listOfButtons.append(Button)
Button.bind("<Button-1>", Function)
root.mainloop()