Quickie: converting r"\x2019" to int

Kent Johnson kent at kentsjohnson.com
Thu Apr 6 13:53:04 EDT 2006


Robin Haswell wrote:
> Hey guys. This should just be a quickie: I can't figure out how to convert
> r"\x2019" to an int - could someone give me a hand please?

Is this what you mean?
In [9]: int(r'\x2019'[2:], 16)
Out[9]: 8217

or maybe you meant this:
In [6]: ord(u'\u2019')
Out[6]: 8217

Kent



More information about the Python-list mailing list