printing longs

garyp gary.porter at authentec.com
Fri Apr 6 17:54:18 EDT 2007


Python 2.3.4 (#1, Oct 26 2004, 16:42:40)
[GCC 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)] on linux2

>>> x = int("80000000", 16)
>>> x = x | 0x80000000

<stdin>:1: FutureWarning: hex/oct constants > sys.maxint will return
positive values in Python 2.4 and up

>>> print "%x" % ( x )
-80000000
>>>

How do I get python to print the usual answer: 8000000, not -80000000

Thanks,
Gary




More information about the Python-list mailing list