【发布时间】:2015-01-24 02:10:14
【问题描述】:
我有下面的代码来运行 Xyce(模拟平台)来模拟我的网表,然后使用 gnuplot 绘制输出 csv 文件。它工作正常并绘制输出文件,但是,我的命令窗口卡在 gnuplot 窗口中。所以我的问题是此时如何退出 gnuplot 以便正常处理我的代码/脚本。我试图打电话给exit 没有用。我还尝试在后台运行 gnuplot,但没有任何运气。最后我尝试了命令terminate(),但也没有运气。那么,有人可以帮忙吗?
#!/usr/bin/env python
# Plotting Output File
import subprocess
import Gnuplot
subprocess.call(['./Xyce','mscmemory_cell.cir'])
g = Gnuplot.Gnuplot()
g.plot(Gnuplot.File('mscmemory_cell.cir.prn', using=(2,3), with_="lines"))
subprocess.call('gnuplot')
【问题讨论】: