title: How do I write a long integer as binary in Python?
body: <p>In Python, long integers have unlimited precision. I would like to write a 16 byte (128 bit) integer to a file. <code>struct</code> from the standard library supports only up to 8 byte integers. <code>array</code> has the same limitation. Is there a way to do this without masking and shifting each integer?</p>
  
  <p>Some clarification here: I'm writing to a file that's going to be read in from non-Python programs, so pickle is out. All 128 bits are used.</p>