Program C spits out sequential doubles to a binary file. I want to read them in Python. I tried to usestruct.unpack('d',f.read(8))
EDIT: I used the following in C to write a random double number
r = drand48();
fwrite((void*)&r, sizeof(double), 1, data);
Errors are now fixed, but I can not read the first value. for the whole number 0.000 .. he reads it as 3.90798504668055, but everything else is in order.
source
share