is there a better way to extract the data from the output using python code
<p>I'm writing a newbie python code to find list of softwares installed on a system from which I will be running the code from. if the software is not installed, i'm planning to say that to the user.</p>

<p>The output will be something like this: (dpkg -l)</p>

<pre><code>A snippet below:
----------------

ii  git                                    1:1.7.9.5-1                             fast, scalable, distributed revision control system
ii  git-man                                1:1.7.9.5-1                             fast, scalable, distributed revision control system (manual pages)


c = subprocess.Popen(['dpkg','-l'],stdout=subprocess.PIPE,stderr=subprocess.PIPE)
list_of_packages,error = c.communicate()
for item in list_of_packages.split('\n'):
    print item.split('ii')[-1]
</code></pre>

<p>which splits and Looks like i will have to apply few more splits to get the required data.
git and 1.7.9.5(version name).</p>

<p>I'm just trying to figure out if there is a better way of achieving this.</p>

<p>please advice..</p>

<p>Thanks,
-Vijay</p>
