I can go one caracter back using \b
:
>>> print("123#456")
123#456
>>> print("123#\b456")
123456
But it doesn't work if a line break is involved :
>>> print("123#\n456")
123#
456
>>> print("123#\n\b456")
123#
456
Is there a way to go line break back ?
I'm asking this because I have a progress at the previous line:
53%
And I use \b
to update the value. But if somebody prints something, it breaks it. I tried to create a buffer of strings and print enought '\b' to compensate for it, then print the buffer back. But it doesn't work if there are line breaks.