> 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
>
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
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
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]:
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:
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)
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
--
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