generating subprocess.call arguments from a list
<p>I am using the subprocess module to execute a command line software with arguments but I am running into a bit of trouble when it comes to feeding it a list of arguments .</p>

<p>Here is what I am doing :</p>

<pre><code>subprocess.call([rv,"[",rv_args[0],rv_args[1],"]",])
</code></pre>

<p>This works fine and <strong>len(rv_args) == 2</strong> , now I would like to generate this :</p>

<pre><code>if len(rv_args) == 4 :
    subprocess.call([rv,"[",rv_args[0],rv_args[1],"]","[",rv_args[2],rv_args[3],"]",])
</code></pre>

<p>then</p>

<pre><code>if len(rv_args) == 6 :
    return subprocess.call([rv,"[",rv_args[0],rv_args[1],"]","[",rv_args[2],rv_args[3],"]","[",rv_args[4],rv_args[5],"]"])
</code></pre>

<p>etc .. etc ..</p>

<p>Of course I don't want to hard code it, but generate it on the fly, what you be the best way ?</p>

<p>cheers,</p>
