4-byte string to integer

Pete Shinners pete at visionart.com
Wed Oct 4 19:00:04 EDT 2000


j vickroy wrote:
>
> How can a 4-byte string be converted to an unsigned integer using
> Python?
>
> The byte order may be either big or little endian.

i believe the struct module can do what you want. it
translates back and forth between binary(ish) data and
character buffers. it even handles endian issues.






More information about the Python-list mailing list