擅长:python、mysql、java
<p>使用</p>
<pre><code>command = subprocess.call(['./myprogram.sh','B','C'],shell=True)
</code></pre>
<p>运行<code>subprocess</code>,结果被分配给<code>command=</code>。你知道吗</p>
<p><code>command=</code>只需要没有<code>()</code>和参数的函数名(正如ambi所说:python<code>callable</code>元素)</p>
<p>可能<code>subprocess</code>正在运行,脚本无法运行其余代码。你知道吗</p>
<p>也许你需要</p>
<pre><code>def myprogram()
subprocess.call(['./myprogram.sh','B','C'],shell=True)
command = myprogram
</code></pre>
<p>你真的需要子流程吗?你知道吗</p>