Possible Duplicate:
backspace character weirdness
I have noticed that 1. If I print only backspaces, i.e. a sequence of \b in Python, then it is completely blank. 2. If I print characters followed by backspaces i.e. 'sssss\b\b\b\b\b', then it will print the multiple 's' characters But if I print something like 'ssss\b\b\b\baaaa', then the backspace, \b, will actually act like I am typing a backspace and delete the 's' characters.
I am using Python 2.6 on Windows XP. Is this expected behavior. If I try to get length of backspace character, it is printed as 1.
Here is my test code -
>>> print 'ssss\b\b\b\b\baaaaa'
aaaaa
>>> print 'ssssssss\b\b\b\b\baaaaa'
sssaaaaa
>>> print 'ssssssss\b\b\b\b\b'
ssssssss
>>> print 'ssssssss\b\b\b\b\baaaaa'
sssaaaaa
>>> print '\b\b\b\b\b'
>>>
My question is- What is the expected behavior when I print '\b' in Python and why the deletion does work in only a particular case?