[Tutor] curious struct problem

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Sat Feb 3 00:09:43 CET 2007



On Fri, 2 Feb 2007, Marcus Goldfish wrote:

> I'm trying to read a binary file using struct.  This code works
> interactively in the IPython shell, but not as a function invoked from a
> command line (Windows).  Can someone point out my error?  Thanks!

Hi Marcus,

There is something very suspicious in the code.  You don't happen to have 
any global variables in your program, do you?

Let me underline what you might want to look at.


> def demux(filename, channel, nchannels):
             ^^^^^^^^

>  infile = open(fname, 'rb')
                  ^^^^^


Good luck!


More information about the Tutor mailing list