On Thu, 06 Apr 2006 20:00:13 +0200, Just wrote: > In article <[EMAIL PROTECTED]>, > Kent Johnson <[EMAIL PROTECTED]> wrote: > >> Robin Haswell wrote:
>> 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 > > Or even: > > >>> import struct > >>> struct.unpack("q", "\0\0"+ r'\x2019')[0] > 101671307850041L > >>> [EMAIL PROTECTED]:~$ python Python 2.4.2 (#2, Sep 30 2005, 21:19:01) [GCC 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu8)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> int("\x2019") 19 >>> Something like that. Except with: >>> int(r"\x2019") Traceback (most recent call last): File "<stdin>", line 1, in ? ValueError: invalid literal for int(): \x2019 >>> :-) -Rob -- http://mail.python.org/mailman/listinfo/python-list