"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
On Sun, 16 Mar 2008 18:45:19 +0100, Martin Blume wrote:
> 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
Completely helped! Working as expected now.
Thanks. You really got me out of a bind!
J.
On Mar 16, 10:23 am, "Martin Blume" <[EMAIL PROTECTED]> wrote:
> "jasonwiener" schrieb
>
> > I am having a VERY odd problem with unpacking right now.
> > I'm reading data from a binary file and then using a
"sturlamolden" schrieb
>
> > This seems to imply that the Mac, although running now
> > on Intel processors, is still big-endian.
>
> Or maybe the struct module thinks big-endian is native
> to all Macs? It could be a bug.
>
Dunno, I'm on thin ice here. Never used a Mac.
Maybe the underlying
you can specifify which encoding when you unpack the struct, so just try
them till it works, or read the specs on the mac.. i find it quicker to try,
there's only 4-5
2008/3/16, sturlamolden <[EMAIL PROTECTED]>:
>
> On 16 Mar, 18:23, "Martin Blume" <[EMAIL PROTECTED]> wrote:
>
> > This seems to im
On 16 Mar, 18:23, "Martin Blume" <[EMAIL PROTECTED]> wrote:
> This seems to imply that the Mac, although running now on Intel
> processors, is still big-endian.
Or maybe the struct module thinks big-endian is native to all Macs? It
could be a bug.
--
http://mail.python.org/mailman/listinfo/p
"jasonwiener" schrieb
>
> I am having a VERY odd problem with unpacking right now.
> I'm reading data from a binary file and then using a very
> simple struct.unpack to get a long. Works fine on my MacBook,
> but when I push it to a Linux box,it acts differently and
> ends up pewking.
> [...]
try twiddling the unpack prefix, they're probably stored in different binary
formats on the disk...
on the struct helppage, is a list of prefixes, can be like
unpack('=HI',data)
unpack('@HI',data)
etc...
find out which one works on each machine
2008/3/16, jasonwiener <[EMAIL PROTECTED]>:
>
> H
Hi-
I am having a VERY odd problem with unpacking right now. I'm reading
data from a binary file and then using a very simple struct.unpack to
get a long. Works fine on my MacBook, but when I push it to a Linux
box,it acts differently and ends up pewking.
here's the code snippet: