Reversing backslashed escape sequences

Steven D'Aprano steve-REMOVE-THIS at cybersource.com.au
Thu Jul 1 02:20:20 EDT 2010


On Wed, 30 Jun 2010 23:11:59 -0700, Chris Rebert wrote:

> Python 2.6.5 (r265:79063, May 25 2010, 18:21:57)
>>>> '\\xFF'.decode('string_escape')
> '\xff'

I knew unicode-escape, obviously, and then I tried just 'escape', but 
never thought of 'string_escape'.

Thanks for the quick answer.


-- 
Steven



More information about the Python-list mailing list