Strange problem with structs Linux vs. Mac
Martin Blume
mblume at freesurf.ch
Tue Mar 18 12:53:55 EDT 2008
"Marc 'BlackJack' Rintsch" schrieb
>
> > I don't think this qualifies as a bug, but I am astonished
> > that the struct module does not tell you whether you are
> > big endian, you have to find out yourself with
> > struct.unpack('@I', s)[0]==struct.unpack(">I", s)[0]
>
> Maybe a little more compact and readable:
>
> In [92]: sys.byteorder
> Out[92]: 'little'
>
Yes, indeed it is more compact and readable.
Thanks.
Martin
More information about the Python-list
mailing list