[Tutor] convert '\\t' to '\t'

Poor Yorick gp@pooryorick.com
Thu Jan 16 13:44:02 2003


Aurelio Magalhaes Dias wrote:

>I think what he wants is like:
>
>>>>text = "something\\nto print"
>>>>text = text.replace('\\n','\n')
>>>>print text
>>>>
>something
>to print
>
In which case, the proper code would be:

 >>> text = "something\\nto print"
 >>> text = text.replace('\\n', '\n')
 >>> text
'something\nto print'
 >>> print text
something
to print
 >>>


Poor Yorick
gp@pooryorick.com