On Fri, 18 Nov 2005 11:10:06 -0500, Carsten Haese wrote:
>> s = long("0xffffffffL")
>> ValueError: invalid literal for long(): 0xffffffffL
>>
>> s = long("0xffffffff")
>> ValueError: invalid literal for long(): 0xffffffffL
>>
>> What can I do?
>>
>> Thank you in advance.
>> Stefan
>
> Leave out the "0x" prefix and tell long() that you're using base 16:
>
>>>> long("ffffffff", 16)
> 4294967295L
Or leave the prefix in, and tell Python to use the prefix to predict the
base:
py> long("0xffffffffL", 0)
4294967295L
--
Steven.
--
http://mail.python.org/mailman/listinfo/python-list