python and bit shifts and byte order, oh my!

Reid Nichol rnichol_rrc at
Fri Sep 10 21:48:43 CEST 2004

Phil Frost wrote:
> The standard 'struct' module provides methods to specify the byte order
> of the input.
> On Fri, Sep 10, 2004 at 02:13:52PM -0500, Reid Nichol wrote:
>>>The code that writes x to a file and reads it from a file is
>>>what you have to worry about.
>>So, I have to handle the byte order myself during file i/o.
>>Thank you Grant and Daniel!  I cleared up a a bunch of my fuzziness :)

It's my understanding that pack and unpack of the struct module returns 
strings and not rearranged integers.

At any rate I would rather do it myself if only to teach myself 
something about this.

More information about the Python-list mailing list