我想从python运行一个外壳命令,并用subprocess.Popen接收它的输出。问题是,当我关闭进程,发送Ctrl-C时,我没有得到任何输出。我做错了什么?File "/usr/lib/python2.6/subprocess.py", line 693, in communicateKeyboardInterrupt
这段python代码在无限循环中运行fbi,即使存在ctrl-C的陷阱。while var == 1:except KeyboardInterrupt因为这段代码是通过ctrl-C退出的 import osx = 0 while var == 1: print x
except KeyboardInterr