title: Write a data variable to binary file in python
body: <p>In Matlab/Octave we have this command to save a variable to binary file:</p>
  <pre><code>a = fwrite(myfile, uint16(x), &quot;uint16&quot;);
  </code></pre>
  <p>I would like to know is there any equivalent command in Python?</p>
  <p>Thank you</p>