"Marcus Goldfish" <[EMAIL PROTECTED]> wrote > I just want to troubleshoot the problem. The error is reproduced as > a > comment below the source. As far as I know, there are no globals; I > am > invoking this from a command line prompt: python demux.py foo.bin 1 > 1
> def demux(fname, ch=1, nchan=1): > fmt = str(nchan) + 'h' # nchan of short (int16) > blockSize = struct.calcsize(fmt) Try a print statement here: print fmt,' = ',blockSize > # file setup > infile = open(fname, 'rb') > #outfile = open(fname + 'ch' + str(ch), 'wb') > > # iterate over data > chunk = infile.read(blockSize) > while chunk: And another print here print chunk Does chunk match the fmt/blockSize above? Alan G _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor