Re: Quickie: converting r"\x2019" to int

2006-04-07 Thread Robin Haswell
> Therefore r'\x2019' is left unchanged, and cannot be converted to an > int. > > Rob, this explains *why* you are getting the above error. It does not > explain how to achieve your objective, as you have not specified what > it is. If you give more information, one of the resident gurus may be >

Re: Quickie: converting r"\x2019" to int

2006-04-07 Thread Serge Orlov
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? >>> int(r'\x2019'.decode('string_escape')) 19 -- http://mail.python.org/mailman/listinfo/python-list

Re: Quickie: converting r"\x2019" to int

2006-04-07 Thread Frank Millman
Robin Haswell wrote: > > [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. Exc

Re: Quickie: converting r"\x2019" to int

2006-04-07 Thread Robin Haswell
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]:

Re: Quickie: converting r"\x2019" to int

2006-04-06 Thread Fredrik Lundh
Just wrote: > > 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:

Re: Quickie: converting r"\x2019" to int

2006-04-06 Thread Just
In article <[EMAIL PROTECTED]>, Kent Johnson <[EMAIL PROTECTED]> wrote: > 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)

Re: Quickie: converting r"\x2019" to int

2006-04-06 Thread Kent Johnson
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 --

Quickie: converting r"\x2019" to int

2006-04-06 Thread Robin Haswell
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? Cheers -Rob -- http://mail.python.org/mailman/listinfo/python-list