擅长:python、mysql、java
<p>如果有一个脚本设置了以后要访问的变量,则必须对其进行源代码设置(类似于其他语言所称的“include”)。你知道吗</p>
<p>而不是</p>
<pre><code>command = './script.sh ; ./configure <configure-flags>'
ret = subprocess.call(command.split())
</code></pre>
<p>你能做到的</p>
<pre><code>command = ["bash", "-c", "source script.sh; ./configure"]
subprocess.call(command)
</code></pre>