Re: reading float from binary data file

2006-03-08 Thread Peter Hansen
cesco wrote: > I have a binary file containing 1000 floating point numbers. I want to > load that file into an array. A way to do it could be the following: > import array data = array.array('f') f = open('FileName.bin', 'rb') data.fromfile(f, 1000) > > Now I have the following pr

Re: reading float from binary data file

2006-03-08 Thread Diez B. Roggisch
cesco schrieb: > Hi, > > I have a binary file containing 1000 floating point numbers. I want to > load that file into an array. A way to do it could be the following: > import array data = array.array('f') f = open('FileName.bin', 'rb') data.fromfile(f, 1000) > > Now I have t

reading float from binary data file

2006-03-08 Thread cesco
Hi, I have a binary file containing 1000 floating point numbers. I want to load that file into an array. A way to do it could be the following: >>> import array >>> data = array.array('f') >>> f = open('FileName.bin', 'rb') >>> data.fromfile(f, 1000) Now I have the following problem: if I don't