Re: Extracting 3-byte integers

2006-06-27 Thread Bob Greschke
>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 doi

Re: Extracting 3-byte integers

2006-06-26 Thread John Machin
On 27/06/2006 9:59 AM, John Machin wrote: > On 27/06/2006 9:36 AM, Bob Greschke wrote: >> 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 co

Re: Extracting 3-byte integers

2006-06-26 Thread Scott David Daniels
Bob Greschke wrote: > 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

Re: Extracting 3-byte integers

2006-06-26 Thread John Machin
On 27/06/2006 9:36 AM, Bob Greschke wrote: > 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 (s

Extracting 3-byte integers

2006-06-26 Thread Bob Greschke
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 mat