Backspace does not erase in stdout

Steven D'Aprano steve+comp.lang.python at pearwood.info
Mon Dec 5 12:24:59 EST 2011


On Mon, 05 Dec 2011 16:23:55 +0000, Grant Edwards wrote:

> On 2011-12-05, Chris Angelico <rosuav at gmail.com> wrote:
>> On Tue, Dec 6, 2011 at 3:09 AM, Steven D'Aprano
>><steve+comp.lang.python at pearwood.info> wrote:
>>>
>>> Is there a way to erase the character other than backspacing, writing
>>> a space, then backspacing again? That feels inelegant.
>>
>> Emitting "\b \b" is one very common way to do a destructive backspace.
>> Inelegant? Perhaps, but a common inelegance.
> 
> That's pretty much the only way I've seen it done for the past 25 years.
> 
> What would be more elegant?

For backspace to actually backspace, and not just move the cursor.

Thanks for those who answered, I guess I'll just do the backspace, space, 
backspace dance.


-- 
Steven



More information about the Python-list mailing list