Extracting 3-byte integers

Bob Greschke bob at passcal.nmt.edu
Mon Jun 26 19:36:23 EDT 2006


I have some binary data read from a file that is arranged like

   <3-byte int> <3-byte int> <3-byte int> etc.

The "ints" are big-endian and there are 169 of them.  Is there any clever 
way to convert these to regular Python ints other than (struct) unpack'ing 
them one at a time and doing the math?

Thanks!

Bob





More information about the Python-list mailing list