I was trying to make my script write a percentage that updates, and I ran into the following problem: I need Python to erase the last bunch of characters I printed, but I can't get it to erase more than 2 characters.
Entering this in Jupyter Notebook
sys.stdout.write("abcd")
sys.stdout.write("\b")
outputs
abc
which is fine, let's erase one more
sys.stdout.write("abcd")
sys.stdout.write("\b\b")
outputs
ab
very well
sys.stdout.write("abcd")
sys.stdout.write("\b\b\b")
outputs
abc
what? What happened? why does it erase just one character instead of 3? What can I do to avoid this?