29 Jul
2010
29 Jul
'10
3:50 a.m.
All, I'm trying to write numpy arrays as binary data, to support a legacy file format. So I open a file and write to it: fp = open('somefile','w') ... oldpos = fp.tell() somenumpyarray.tofile(fp) newpos = fp.tell() diff = newpos - oldpos - somenumpyarray.nbytes if diff != 0: print 'ahhah! mismatch=',diff ... I'm observing that every once in while I get 'ahhah! mismatch=1', that is, the file position is advanced by one more byte than x.nbytes would give. I'm using 1.4.1 on windows, python 2.5. Any ideas? Thanks, Paul Probert University of Wisconsin
5012
Age (days ago)
5012
Last active (days ago)
2 comments
2 participants
participants (2)
-
Christopher Barker
-
Paul Probert