So guys I'm new to GUIs in Python and I've been trying to understand the envents process, here's my code, and the intention that whenever I press the 'a' key it should print "key pressed'. But it won't work for me.
#!/usr/bin/env python3
# -*-coding:UTF-8 -*
from tkinter import *
root = Tk()
def callback(event):
print("key pressed")
canvas = Canvas(root, width=100, height=100, bg='blue')
canvas.bind("a", callback)
canvas.pack()
root.mainloop()