title: How to write list of integers into file with Python 2.7?
body: <p>I have list</p>
  
  <pre><code>[4, 5, 7, 8, 10, 11, 13, 14, 16, 17, 19, 21, 22, 24, 25, 36, 39, 40, 43, 45, 46, 48, 49, 55, 57, 58, 60, 61, 64, 68, 71, 72, 74, 75, 77, 78, 80, 81, 82, 84, 86, 87, 89, 90, 92, 93, 95, 96, 98, 99, 101, 102, 104, 105, 107, 108, 110, 112, 113, 115, 116, 118, 122, 125, 127, 128, 130, 131, 133, 134, 136, 137, 139, 140]
  </code></pre>
  
  <p>I have tried with <code>pickle</code></p>
  
  <pre><code>with open('m1.dat', 'wb') as f:
      pickle.dump(matches1, f)
  </code></pre>
  
  <p>but got characters like this</p>
  
  <pre><code>(lp0
  I4
  aI5
  aI7
  aI8
  aI10
  aI11
  aI13
  aI14
  aI16
  aI17
  aI19
  aI21
  aI22
  aI24
  </code></pre>