title: What is the best way to merge 2 byte arrays?
body: <p>Let's suppose i have 2 bigs arrays (i have put smaller arrays in this example):</p>
  
  <pre><code>a1=bytes([10,20,30,40,50,60,70,80])
  a2=bytes([11,21,31,41,51,61,71,81])
  </code></pre>
  
  <p>What i want to do is to merge this 2 arrays this way:</p>
  
  <pre><code>[10,20 , 11,21 , 30,40 , 31,41 , ...
  </code></pre>
  
  <p>What i want is to take 2 bytes from first array, then 2 from second array, etc.</p>
  
  <p>Here is what i done. It works but i think there is a best way to do this, without having to create intermediates arrays:</p>
  
  <pre><code>a3 = bytearray()
  for i in range(0, len(a1), 2):
      a3.append(a1[i])
      a3.append(a1[i+1])
      a3.append(b1[i])
      a3.append(b1[i+1])
  
  output_array=bytes(a3)  # Very important: i need bytes() object at the end
  </code></pre>