how to kill (or avoid) zombie processes with subprocess module

后端 未结 9 1204
悲&欢浪女
悲&欢浪女 2020-11-29 22:10

When I kick off a python script from within another python script using the subprocess module, a zombie process is created when the subprocess \"completes\". I am unable to

9条回答
  •  执念已碎
    2020-11-29 22:44

    Like this:
    s = Popen(args)
    s.terminate()
    time.sleep(0.5)
    s.poll()

    it works
    zombie processes will disappear

提交回复
热议问题