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:
[color=blue][color=green][color=darkred]
>>> import array
>>> data = array.array('f' )
>>> f = open('FileName. bin', 'rb')
>>> data.fromfile(f , 1000)[/color][/color][/color]
Now I have the following problem: if I don't know how many values the
file contains and I want to read all the values till the last one what
shall I do?
Thanks & regards
Francesco
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:
[color=blue][color=green][color=darkred]
>>> import array
>>> data = array.array('f' )
>>> f = open('FileName. bin', 'rb')
>>> data.fromfile(f , 1000)[/color][/color][/color]
Now I have the following problem: if I don't know how many values the
file contains and I want to read all the values till the last one what
shall I do?
Thanks & regards
Francesco
Comment