Run a process and quit without waiting for it

后端 未结 5 1418
-上瘾入骨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:15

    Under Linux you could fork but this won't work on Windows. I think the easiest way is to run a new Python process, by putting your count_sheeps in a seperate file and Popen('python count_sheeps.py')

提交回复
热议问题