convert string to the "escaped string"

Petr Jakes petr at tpc.cz
Sat Nov 12 09:04:12 EST 2005


Hi,
I am trying to convert string to the "escaped string".
example: from "0xf" I need "\0xf"
I am able to do it like:

a="0xf"
escaped_a=("\%s" % a ).decode("string_escape")

But it looks a little bit complicated in this beautiful language to me
....

Regards

Petr Jakes




More information about the Python-list mailing list