0
我有一個執行遠程命令的python腳本,我想在其中使用多處理。使用paramiko執行命令時無法終止進程
我設法讓自己的工作程序,但是嘗試使用CTRL中斷它時, + Ç,我得到下面的異常,並且程序沒有正確終止:
Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python2.7/multiprocessing/pool.py", line 102, in worker
task = get()
File "/usr/lib/python2.7/multiprocessing/queues.py", line 376, in get
return recv()
KeyboardInterrupt
Caught KeyboardInterrupt, terminating workers
我究竟做錯了什麼?
試圖重寫問題以便於理解。還有一些格式化 –
[類似問題](http://stackoverflow.com/questions/11312525/catch-ctrlc-sigint-and-exit-multiprocesses-gracefully-in-python) –