Using repr() with escape sequences

Sybren Stuvel sybrenUSE at YOURthirdtower.com.imagination
Thu Feb 23 12:10:47 EST 2006


nummertolv enlightened us with:
> myString = "bar\foo\12foobar"

Are the interpretations of the escape characters on purpose?

> How do I print this string so that the output is as below?
>
> bar\foo\12foobar

Why do you want to?

> typing 'print myString' prints the following:
>
> baroo
> foobar

Which is correct.

Sybren
-- 
The problem with the world is stupidity. Not saying there should be a
capital punishment for stupidity, but why don't we just take the
safety labels off of everything and let the problem solve itself? 
                                             Frank Zappa



More information about the Python-list mailing list