范雅惠keyevents期末考
from tkinter import *
def doSomething(event):
#print("范雅惠按下: " + event.keysym)
label.config(text=event.keysym)
window = Tk()
window.bind("<Key>",doSomething)
window.title("范雅惠期末考") #加上title
label = Label(window,font=("Helvetica",350),bg='#FF77FF')
label.pack()
window.mainloop()
评论
发表评论