Answers for "how to detect button presses in python"

-1

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()
Posted by: Guest on May-27-2021

Code answers related to "how to detect button presses in python"

Python Answers by Framework

Browse Popular Code Answers by Language