Canvas a method called dchars()
which you can use to delete characters of canvas text.
syntax: canvas.dchars(tagOrId, first, last)
dchars
deletes characters from a text item or items. you can specify from which index you want you delete. For example, canvas.dchars(tag, 1, 3) will remove the second, third and fourth characters.
To delete the last character of the text use canvas.index(tagOrId, specifier)
to get the index of the last character. The specifier tkiner.END
returns the last index of the string, then use dchars
as shown below.
from tkinter import *
def update(event):
canvas.dchars('text', canvas.index('text' ,END)-1 )
window = Tk()
canvas = Canvas(window,width=300, height=300, bd=0)
canvas.pack()
canvas_textbox = canvas.create_text(20, 70, text='Text', fill="red", tag='text')
canvas.bind('<Button>', update)
window.mainloop()