python and string from list as parameter
<p>I'm trying to write a Python script that reads lines of strings from a file and executes a bash-shell command with each line as parameter:</p>

<pre><code>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os

lines = [line.strip() for line in open('/tmp/i586rpm.txt')]
for rpm in lines:
    try:
        s = os.system("rpm -qip") % lines

    except Exception:
        print "Something wrong"
</code></pre>

<p>But I always get an error. I think that there is something wrong with <code>% lines</code>.</p>

<p>Any ideas?</p>
