Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Outputting \b in python?

 
Luke Murphy
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 300
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2407
32
Linux Oracle Postgres Database Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic