Parsing a stdout in Python
<p>In Python I need to get the version of an external binary I need to call in my script.</p>

<p>Let's say that I want to use <a href="http://en.wikipedia.org/wiki/Wget" rel="nofollow">Wget</a> in Python and I want to know its version.</p>

<p>I will call </p>

<pre><code>os.system( "wget --version | grep Wget" ) 
</code></pre>

<p>and then I will parse the outputted string.</p>

<p>How to redirect the stdout of the os.command in a string in Python?</p>
