title: replace part of path - python
body: <p>Is there a quick way to replace part of the path in python? </p>
  
  <p>for example:</p>
  
  <pre><code>old_path='/abc/dfg/ghi/f.txt'
  </code></pre>
  
  <p>I don't know the beginning of the path (<code>/abc/dfg/</code>), so what I'd really like to tell python to keep everything that comes after <code>/ghi/</code> (inclusive) and replace everything before <code>/ghi/</code> with <code>/jkl/mno/</code>:</p>
  
  <pre><code>&gt;&gt;&gt; new_path
      '/jkl/mno/ghi/f.txt/'
  </code></pre>