title: Strip intermediate folders in filepath name (Python)
body: <p>I have a path <code>/foo/bar/poo/car</code> and there are files in the directory <code>car</code>.
  I want to end up with <code>/foo/bar</code> with the same files in <code>bar</code>. I realized this is wrong since it doesn't maintain the files:</p>
  
  <pre><code>&gt;&gt;&gt; import os
  &gt;&gt;&gt; os.path.dirname(os.path.dirname('/foo/bar/poo/car'))
  '/foo/bar'
  </code></pre>
  
  <p>I guess I would have to first move the files from car to bar and then do the above? Is there a cleaner or easier way to perform this?</p>