Search code examples
pythonbackspace

\b (backspace) not functioning correctly in Python IDLE, instead printing box character


I am writing a program for a simple loading animation, like the one you see while Window Command is processing something. Unfortunately, this does not seem to function in Python IDLE.
I discovered that the root of the problem was Python's \b function, which is supposed to backspace the character written before it. For some reason, this instead prints a character. When opened in CMD, it works just as its supposed to.

Any ideas of what could be wrong?

Example of backspace not working in IDLE: img


Solution

  • One answer is that IDLE doesn't support \b, so it puts the box with a question mark. there is no way to fix this, other than asking Python to add support for it.