As stated in the title, I'm trying to delete a character right after it was entered into a text field.
import tkinter as tk
window = tk.Tk()
input = tk.Text()
input.pack()
def handle_keypress(event):
print("test")
input.delete("1.0")
input.bind("<Key>", handle_keypress)
window.mainloop()
The following code deletes the character only after another one is typed. The print statement, however, works instanly as expected. I wonder what is causing this behaviour and how it can be fixed. Thankful for any clue.