Question

For example \b backspace prints as quad (shown as [] in example below). But \n newline is Ok.

>>> print 'abc\bd'
abc[]d
>>> print 'abc\nd'
abc
d

Im running under Vista (pro), python 2.7

Ive tried googling this issue generally and in SO and cant find anything relevant, which seems odd and makes me wonder if theres some setting or other may be wrong in my setup. Not sure what to look for.

Was it helpful?

Solution

What am I doing wrong or what should I be looking for?
Is it reasonable to expect backspace, specifically, to work?

No, IDLE does not support backspace, nor carriage-return, nor formfeed, nor ANSI escape sequences.

You are expecting \b to move the cursor one cell to the left in IDLE's interactive shell window. It doesn't do that. IDLE does not support cursor addressing in its shell window, with the exception of newline and tab.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top