I am working on a project in python, and I made a method to draw a specific thing in tkinter. I want it so that whenever I press the spacebar, the image will redraw itself (
You can aslo use canvas.bind_all("", yourFunction) That will listen for events in the whole application and not only on widget.
canvas.bind_all("", yourFunction)