From 5ce4719a1ba7e4f60e9e3df974b10d40023c4a9b Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Thu, 14 Jan 2021 19:57:37 -0800 Subject: [PATCH] Avoid re-running ltspice --- Lab2/process.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Lab2/process.py b/Lab2/process.py index 63f5dda..0aeda21 100644 --- a/Lab2/process.py +++ b/Lab2/process.py @@ -129,9 +129,10 @@ def run_sim(script, model, mos, callback): f.write(simulations[model][1].format(simulations[model][0])) if mos is not None: f.write(moss[mos]) f.write(script) - # sp = os.popen("wine ~/.wine/drive_c/Program\ Files/LTC/LTspiceXVII/XVIIx64.exe -b {}.cir -ascii" - # .format(scriptname)) - # sp.read() + if not os.path.exists(scriptname + ".raw"): + sp = os.popen("wine ~/.wine/drive_c/Program\ Files/LTC/LTspiceXVII/XVIIx64.exe -b {}.cir -ascii" + .format(scriptname)) + sp.read() l = ltspice.Ltspice(scriptname + ".raw") l.parse()