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

后端 未结 9 1228
悲&欢浪女
悲&欢浪女 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:46

    If you delete the subprocess object, using del to force garbage collection, that will cause the subprocess object to be deleted and then the defunct processes will go away without terminating your interpreter. You can try this out in the python command line interface first.

提交回复
热议问题