Making Python code Pythonic
<p><strong>How would you make the give code more Pythonic?</strong></p>

<p>I want to get Paths out of the sample like <code>/usr/local/sources/devel/algebra.py: def _alg(...)</code> without the character <code>:</code>.</p>

<p><strong>My code</strong></p>

<pre><code>import os
FunctionPath = "/usr/local/sources/devel/sage-main/build/sage/"
cmd = "grep -R 'def ' %s | cut -d' ' -f1" % (FunctionPath)
cmd += ' &amp;'
raw_path = os.system(cmd)
path = raw_path.replace(':', '')       // not working

print path
</code></pre>

<p>[edit]: The code <em>cannot be written pythonically</em> only with Built-in functions. </p>
