Run a process and quit without waiting for it

后端 未结 5 1412
-上瘾入骨i
-上瘾入骨i 2021-02-20 11:36

In Python under Windows: I want to run some code in a separate process. And I don\'t want the parent waiting for it to end. Tried this:

from multiprocessing impo         


        
5条回答
  •  庸人自扰
    2021-02-20 12:27

    You can always start a new thread, and call myNewThread.daemon(True) before invoking it's start() method.

    That thread will continue to run when the main process exits.

提交回复
热议问题