def f(): print('xy', end='') print(' zz') f() >> zz // make cursor reset to the start of the line and over-write any text after that