擅长:python、mysql、java
<p>&;是shell运算符,默认情况下POpen不使用shell。</p>
<p>如果要使用shell功能,请在POpen调用中使用shell=True,但请注意,它的速度稍慢/内存占用较多。</p>
<pre><code>p1 = subprocess.Popen(["mmls", "WinXP.E01", "&&", "echo", "-e", "\"\n\"", "&&", "stat", "WinXP.E01"],
stdout=subprocess.PIPE, shell=True)
</code></pre>