File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Jython/Python and the fly likes Outputting \b in python? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Languages » Jython/Python
Bookmark "Outputting \b in python?" Watch "Outputting \b in python?" New topic
Author

Outputting \b in python?

Luke Murphy
Ranch Hand

Joined: May 12, 2010
Posts: 300
I want to output

> \b

, so I do:

print('\b')
and a fancy symbol is outputted instaed. This doesn't happen for other letters? So how do I actually output

> \b

? Sorry this question is simple but not much comes in google when you do a search for this character combination...
Luke Murphy
Ranch Hand

Joined: May 12, 2010
Posts: 300
Luke Murphy wrote:I want to output

> \b

, so I do:

print('\b')
and a fancy symbol is outputted instaed. This doesn't happen for other letters? So how do I actually output

> \b

? Sorry this question is simple but not much comes in google when you do a search for this character combination...


Answer...

print('\\b')
chris webster
Bartender

Joined: Mar 01, 2009
Posts: 1658
    
  14

You probably figured out by now that '\b' is a special character (backspace), just as '\t' is a tab, and '\n' is a newline, etc.


No more Blub for me, thank you, Vicar.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Outputting \b in python?