Python: Using popen poll on background process

前端 未结 3 553
陌清茗
陌清茗 2021-01-31 10:31

I am running a long process (actually another python script) in the background. I need to know when it has finished. I have found that Popen.poll() always returns 0

3条回答
  •  忘了有多久
    2021-01-31 11:05

    You shouldn't run your script with ampersand at the end. Because shell forks your process and returns 0 exit code.

提交回复
热议问题