print string as raw string

Tino Wildenhain tino at
Tue Feb 17 11:33:56 CET 2009

Mirko Dziadzka wrote:
> Hi all
> I'm trying to find a way to output strings in the raw-string format, e.g.
> print_as_raw_string(r"\.") should output r"\." instead of "\\."
> Is there a better way than writing your own print function? Some magic
> encoding?

Thats nonsense. print r"\." or in python3.0 print(r"\.")
will just print:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3241 bytes
Desc: S/MIME Cryptographic Signature
URL: <>

More information about the Python-list mailing list