title: Read binary file which has different datatypes
body: <p>Attempting to read a binary file produced in Fortran into Python, which has some integers, some reals and logicals. At the moment I read the first few numbers correctly with:</p>
  
  <pre><code>x = np.fromfile(filein, dtype=np.int32, count=-1)
  firstint= x[1]
  ...
  </code></pre>
  
  <p>(np is numpy). 
  But the next item is a logical. And later on ints again and after reals. How can I do it?</p>