我不明白什么时候需要杀死子进程。
for package in server.packages:
n = subprocess.Popen(['which', package], stdout=subprocess.DEVNULL)
n.wait()
if n.returncode != 0:
n.kill()
<some other code>
Run Code Online (Sandbox Code Playgroud)
我收到错误(使用 Python3):
ProcessLookupError: [Errno 3] No such process
Run Code Online (Sandbox Code Playgroud)
任何人都可以解释我什么时候子进程自杀以及什么时候需要手动完成?