I have a program that shows an image. Every time the user presses enter, I recalculate the image, what takes some time:
root = tk.Tk()
def callback_enter(e):
# Heavy computation
root.bind("<Return>", callback_enter)
root.mainloop()
The problem is, when the user presses enter multiple times, callback function will be called again and again, even when the user stopped pressing the button, since the program remembers all the key presses before. Is there a way callback_enter()
removes all key presses, that have been done during its execution?