ascii - My "\b" character prints a blank space rather than deletes to the left. Is this normal? -


i'm trying replace or delete printed line i'm trying use /b. when enter: print "p\by\bt\bh\bo\bn"

it prints out "p y t h o n" rather replacing characters. using special char incorrectly?

that works fine, in normal environment:

>>> print "p\by\bt\bh\bo\bn" n 

the first thing would check outputting. if you're under unix-like os, can put following line script called qq.py:

print "p\by\bt\bh\bo\bn" 

the run it, converting output hex dump:

pax> python qq.py | od -xcb 0000000    0870    0879    0874    0868    086f    0a6e           p  \b   y  \b   t  \b   h  \b   o  \b   n  \n         160 010 171 010 164 010 150 010 157 010 156 012 0000014 

that shows output indeed consist of correct characters. if see that, there's wrong terminal setting in backspace not set correctly, in case it's environmental issue outside scope of programming.


Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -