Re: finding byte order

2004-12-07 Thread biner . sebastien
Scott David Daniels wrote: > biner wrote: > > I am using a program that has to read binary data from files coming > > from different machines. The file are always written with big endian. > > Diez B. Roggisch wrote: > [Scott David Daniels wrote] > >>How about sys.byteorder? > > This doesn't h

Re: finding byte order

2004-12-03 Thread Diez B. Roggisch
> But, in fact, he says the files are always big endian. So, code like > the following should address his problem. Note I use type 'h' as an > example so I can easily read samples. I'm sorry, I confused that he asked for machine endianess. Then of course you are right. -- Regards, Diez B. Rog

Re: finding byte order

2004-12-03 Thread Scott David Daniels
biner wrote: > I am using a program that has to read binary data from files coming > from different machines. The file are always written with big endian. Diez B. Roggisch wrote: [Scott David Daniels wrote] How about sys.byteorder? This doesn't help, as he wants to read files from varying endian

Re: finding byte order

2004-12-03 Thread Jp Calderone
On Fri, 03 Dec 2004 19:19:48 +0100, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> I would like to have a test to tell me if the current machine is ^^^ > > using big or small endian, this way I could use the array module in > > the

Re: finding byte order

2004-12-03 Thread Diez B. Roggisch
> I would like to have a test to tell me if the current machine is > using big or small endian, this way I could use the array module in > the first case and the *slower* struct module on the second. I looked > but did not find. Is there a python function to know that? There is no such test, as

Re: finding byte order

2004-12-03 Thread Diez B. Roggisch
> How about sys.byteorder? This doesn't help, as he wants to read files from varying endianess - what the _current_ endianess is doesn't matter here. -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: finding byte order

2004-12-03 Thread Scott David Daniels
biner wrote: > I would like to have a test to tell me if the current machine is > using big or small endian, this way I could use the array module in > the first case and the *slower* struct module on the second. I looked > but did not find. Is there a python function to know that? > > Thanks! Ho

finding byte order

2004-12-03 Thread biner
Hello, I am using a program that has to read binary data from files coming from different machines. The file are always written with big endian. I am using the struct module to read the data and it is fine because I can specify in the format if the data are to be read with big or small endian co