how to detect a button press in python code example
Example: how to detect button presses in python
from tkinter import *
def doSomething(event):
#print("You pressed: " + event.keysym)
label.config(text=event.keysym)
window = Tk()
window.bind("<Key>",doSomething)
label = Label(window,font=("Helvetica",100))
label.pack()
window.mainloop()