擅长:python、mysql、java
<p>更改:</p>
<pre><code>subprocess.call("ghdl -a ieee=synopsys -fexplicit " + testBenchFile + " >> a_log.txt", shell = True)
</code></pre>
<p>收件人:</p>
^{2}$
<p>你也可以变得更“Python式”,好好处理你的日志文件:</p>
<pre><code> log_file = open("a_log.txt", "a")
subprocess.call(["ghdl", "-a", " ieee=synopsys", "-fexplicit", testBenchFile], shell = True, stdout=log_file)
</code></pre>
<p>使用<code>stdout</code>参数重定向命令的输出,类似于<code>></code>。但是,由于文件是使用<code>"a"</code>模式打开的,因此您将模拟<code>>></code>。在</p>