سؤال

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.

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top