title: Joining concurrent Python Output
body: <p>I'm using something like this:</p>
  
  <pre><code>find folder/ | xargs -n1 -P10 ./logger.py &gt; collab
  </code></pre>
  
  <p>Inside <code>logger.py</code> I am processing the files out outputting reformatted lines. So collab should look like</p>
  
  <pre><code>{'filename' : 'file1', 'size' : 1000}
  {'filename' : 'file1', 'size' : 1000}
  {'filename' : 'file1', 'size' : 1000}
  {'filename' : 'file1', 'size' : 1000}
  </code></pre>
  
  <p>Instead sometimes the lines are getting jumbled:</p>
  
  <pre><code>{'filename' : 'file1', 'size' : 1000}
  {'file
  {'filename' : 'file1', 'size' : 1000}
  name' : 'file1', 'size' : 1000}
  {'filename' : 'file1', 'size' : 1000}
  </code></pre>
  
  <p>How can I prevent / correct this?</p>