Read Binary data

2008-09-04 Thread Mars creature
Hi guys, I am trying to read a binary file created by the following matlab command: fid=fopen('a.bin','w','b'); fwrite(fid,a,'real*8'); fclose(fid);, and wondering how to do it in Python. I googled it but still get confused. 'b' in fopen is for 'big-endian', 'real*8' in fwrite is for 64bit floa

Re: Read Binary data

2008-09-04 Thread Mars creature
On Sep 4, 12:03 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > "Mars creature" wrote: > > I am trying to read a binary file created by the following matlab > > command: > > fid=fopen('a.bin','w','b'); fwrite(fid,a,'real*8

Read and write binary data

2008-09-07 Thread Mars creature
Hi guys, I am new to Python, and thinking about migrating to it from matlab as it is a really cool language. Right now, I am trying to figure out how to control read and write binary data, like 'formatted','stream','big-endian','little-edian' etc.. as in fortran. I googled, but can not find a cle

Re: Read and write binary data

2008-09-08 Thread Mars creature
On Sep 7, 8:55 pm, Patrick Maupin <[EMAIL PROTECTED]> wrote: > On Sep 7, 5:41 pm, Mars creature <[EMAIL PROTECTED]> wrote: > > > Hi guys, > > I am new to Python, and thinking about migrating to it from matlab > > as it is a really cool language. Right now,

How to pass a global variable to a module?

2009-09-29 Thread Mars creature
Dear Python users, I just start to use python and love this language. I met this problem when I try to save my functions in a separate file. The question is how I can pass a global variable to a function which is saved in another file. If I save the function I defined in the same file with the ma

Re: How to pass a global variable to a module?

2009-09-29 Thread Mars creature
On Sep 29, 12:49 pm, "Rami Chowdhury" wrote: > On Tue, 29 Sep 2009 09:40:29 -0700, Mars creature wrote: > > Dear Python users, > >   I just start to use python and love this language. I met this > > problem when I try to save my functions in a separate file. >

Re: How to pass a global variable to a module?

2009-09-30 Thread Mars creature
On Sep 30, 5:31 am, Jean-Michel Pichavant wrote: > Mars creature wrote: > > On Sep 29, 12:49 pm, "Rami Chowdhury" > > wrote: > > >> On Tue, 29 Sep 2009 09:40:29 -0700, Mars creature wrote: > > >>> Dear Python users, > >>>