title: Concatenate / Split two bytes using unique character
body: <p>I am encoding two images into bytes then concatenating the bytes into one bytes blob to send it via socket communication.</p>
  <p>At server side, I want to split this blob back into two bytes sequences in order to decode it back to its original form.</p>
  <p>Since images do not contain commas, I am concatenating the bytes using <code>,</code> character, but when I try to split the bytes back, it returns multiple chunks of bytes.</p>
  <p>This is what I have so far</p>
  <pre><code>import requests
  from io import BytesIO
  
  url = &quot;https://upload.wikimedia.org/wikipedia/en/7/7d/Lenna_%28test_image%29.png&quot;
  
  img = BytesIO(requests.get(url).content).read()
  data = b&quot;,&quot;.join([img, img])
  img1, img2 = data.split(b&quot;,&quot;)
  </code></pre>
  <p>In my example, the data is split into 3646 sub-sequences of bytes.</p>
  <ol>
  <li>What is wrong with my code?</li>
  <li>What  is the fix for it?</li>
  </ol>