Escape chars in string

Ivo Woltring TheDolphin at ivonet.nl
Tue Nov 9 13:55:10 EST 2004


"Jeff Epler" <jepler at unpythonic.net> wrote in message
>Python 2.3 has a 'string-escape' codec.  If you have a string like '\\t'
>(a literal backslash followed by a t) and want to turn it into the
>string '\t' (a tab character), you can use it for that purpose:
>    >>> r"a\tb".decode("string-escape")
>    'a\tb'

>Jeff

Thanx!
exactly what i needed
Ivo.





More information about the Python-list mailing list