title: What is the best method to read a double from a Binary file created in C?
body: <p>A C program spits out consecutive doubles into a binary file. I wish to read them into Python. I tried using <code>struct.unpack('d',f.read(8))</code></p>
  
  <p>EDIT:
  I used the following in C to write a random double number</p>
  
  <pre><code>r = drand48();
  fwrite((void*)&amp;r, sizeof(double), 1, data);
  </code></pre>
  
  <p>The Errors are now fixed but I cannot read the first value. for an all 0.000.. number it reads it as 3.90798504668055 but the rest are fine.</p>