擅长:python、mysql、java
<p>您正在创建<code>subprocess.Popen</code>的实例,但没有执行它。在</p>
<p>你应该试试:</p>
<pre><code>p = Popen(["hrun", "DAR_MeasLogDump ", log_file_name], stdout=subprocess.PIPE, stderr = subprocess.PIPE, cwd=cwdir, encoding='utf-8')
out, err = p.communicate() # This will get you output
</code></pre>
<p>如果不使用<code>shell=True</code>,然后使用<code>executable</code><a href="https://docs.python.org/3/library/subprocess.html#subprocess.Popen" rel="nofollow noreferrer">should not be required</a>,则应将参数作为序列传递。在</p>
<p>请注意,如果您没有使用<code>Popen</code>中的高级功能,doc建议您使用<a href="https://docs.python.org/3/library/subprocess.html#subprocess.run" rel="nofollow noreferrer">^{<cd5>}</a>:</p>
^{pr2}$