[Numpy-discussion] Unexpected tofile() behavior

Jeffery Kline jeffery.kline@gmail....
Thu Feb 4 15:28:33 CST 2010


I am experiencing unexpected behavior with the tofile() function.  I try to write two files with but distinct names, but only one of the files is written.

The following code illustrates. For me, it only writes the file 't.bin'.

from numpy import *
t=arange(0,1,0.1)
T=arange(0,1,0.1)
t.tofile('t.bin')
T.tofile('T.bin')

Meanwhile, the following code works as I expect by writing 't.bin' and 'S.bin':

from numpy import *
t=arange(0,1,0.1)
T=arange(0,1,0.1)
t.tofile('t.bin')
T.tofile('S.bin')

Am I doing something stupid or overlooking something obvious? 

My system is Mac os x 10.6.2, running python 2.6.4.
Jeff


More information about the NumPy-Discussion mailing list