I want to run ngspice through a xterm window in an application written in PyQt4. But I am not able to capture the exit signal of the ngspice process. I learned how to do the same for unix shell commands from the following link. But when I replace the shell command with ngspice, then the exit code is not getting propagated.
Asked
Active
Viewed 118 times
1 Answers
0
It will do (tested in a CYGWIN64 console window under MS Windows):
$ xterm -e sh -c 'ngspice ; echo $? > echo_status.txt'
ngspice opens up. Terminate ngspice with
quit 33
Then enter
cat echo_status.txt
to the console window, and the answer will be
33

Holger
- 41
- 3