Using only tkinter (bytes offset? need more testing):
- start:
'1.0', '0.0 + N chars'
- middle:
'1.0 + Nc', 'end - Nc'
# both N need to be the same - end:
'end - Nc', 'end'
# need to use N + 1 here
N is to be replaced by the number of char/bytes needed to act on. This wasn't tested extensively, but it seems to hold up when tested with text.delete:
def testdelete_start(event=None):
text.delete('1.0', '0.0 + 3 chars') # change this line here