signed to unsigned
kj4eit at gmail.com
Fri Feb 17 20:10:36 CET 2012
> Pack it as the actual type, then unpack it as the desired type:
> Python 2.7.1 (r271:86832, Jul 31 2011, 19:30:53)
> Type "help", "copyright", "credits" or "license" for more information.>>> from struct import pack, unpack
> >>> unpack('=I', pack('=i',-327681234))
> I would think there's some more efficient way to do this though.
Thanks Chris! I was doing it backwards. I only have a few of these
right now, so performance isn't a concern. I appreciate the advice.
More information about the Python-list