My code:
from tkinter import *
import tkinter as tk
root = Tk()
def Hello():
print("You press '<' key")
root.bind("<", Hello)
root.mainloop()
But I receive error:
_tkinter.TclError: no event type or button # or keysym
I tried "<<>"
and "Shift-,"
but it does not work.
What you're looking for is this:
root.bind("<less>", Hello)
You can find a compete list of Key-Synonyms in the original documentation of Tk.