title: Translating an integer into two-byte hexadecimal with Python
body: <p>I need to take an integer (for example, -200) and change it into a hexadecimal (FF 38), then into an integer 0-255 to send via serial. The example I was given was: </p>
  
  <pre><code>-200 = hex FF38 = [hex FF] [hex 38] = [255] [56]
  </code></pre>
  
  <p>I've tried using <code>struct.pack('&gt;h', -200)</code> but that returned the incorrect value. I also tried <code>hex()</code> but that returned a negative hex value that was incorrect as well.</p>
  
  <p>I don't know what else I should be trying. </p>