前提・実現したいこと
Python3.6.8 にて、multiprocessing を使用している最中に keyboardInterrupt して正常終了したい
発生している問題・エラーメッセージ
Error in atexit._run_exitfuncs: Traceback (most recent call last): File "/usr/lib/python3.6/multiprocessing/popen_fork.py", line 28, in poll pid, sts = os.waitpid(self.pid, flag) KeyboardInterrupt
該当のソースコード
python3
1import multiprocessing 2import time 3 4def hoge(n): 5 try: 6 while True: 7 print("hoge", n) 8 time.sleep(n) 9 except KeyboardInterrupt: 10 pass 11 12for i in [1, 2]: 13 multiprocessing.Process(target=hoge, args=(i,)).start()
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/06/27 01:43
2019/06/27 02:20