How to convert \n and \t symbols to new lines and tabs?

MRAB google at mrabarnett.plus.com
Mon Apr 13 19:52:11 EDT 2009


DSblizzard wrote:
> How to convert string with \n and \t symbols to natural string - with
> new lines and tabs?
> 
You'll need to explain what you mean.

A string literal represents newline and tab with \n and \t. Are you
talking about that, or does the string actually contain the characters
\n and \n? What do you see what you print it? What do you see when you
use repr and print the result?



More information about the Python-list mailing list