How to convert a "long in a string" to a "long"?

Steven Bethard steven.bethard at gmail.com
Fri Nov 18 11:22:24 EST 2005


ondekoza at gmail.com wrote:
>>>>0xffffffffL
> 
> 4294967295L
> 
> OK, this is what I want, so I tried
> 
> s = long("0xffffffffL")
> ValueError: invalid literal for long(): 0xffffffffL

 >>> int("0xffffffff", 0)
4294967295L

STeVe



More information about the Python-list mailing list