In article ,
boblatest wrote:
>
>I'd like to have control characters in a string to be converted to
>their backslash-escaped counterparts. I looked in the encoders section
>of the string module but couldn't find anything appropriate. I could
>write it myself but I'm sure something of the sort exi
On Feb 8, 12:28 pm, Chris Rebert wrote:
> print a.encode("string-escape")
How could I miss that? I was on that doc page already. Should have
typed "/escape" in the browser ;-)
Thanks,
robert
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, Feb 8, 2010 at 3:14 AM, boblatest wrote:
> Hello,
>
> I'd like to have control characters in a string to be converted to
> their backslash-escaped counterparts. I looked in the encoders section
> of the string module but couldn't find anything appropriate. I could
> write it myself but I'm
Hello,
I'd like to have control characters in a string to be converted to
their backslash-escaped counterparts. I looked in the encoders section
of the string module but couldn't find anything appropriate. I could
write it myself but I'm sure something of the sort exists. The
hypothetical method "