print string as raw string

Tino Wildenhain tino at wildenhain.de
Tue Feb 17 05:33:56 EST 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:
\.

Regards
Tino
-------------- 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: <http://mail.python.org/pipermail/python-list/attachments/20090217/71f34201/attachment.bin>


More information about the Python-list mailing list