title: Packing an integer number to 3 bytes in Python
body: <p>With background knowledge of C I want to serialize an integer number to 3 bytes. I searched a lot and found out I should use struct packing. I want something like this:</p>
  
  <pre><code>number = 1195855
  buffer = struct.pack("format_string", number)
  </code></pre>
  
  <p>Now I expect buffer to be something like <code>['\x12' '\x3F' '\x4F']</code>. Is it also possible to set endianness?</p>