Your question is not too clear, but If I assume that you are about to launch a process wich goes to zombie and you want to be able to control that in some state of your script. If this in the case, I propose you the following:
p = subprocess.Popen([cmd_list], shell=False)
This in not really recommanded to pass through the shell.I would suggest you ti use shell=False, this way you risk less an overflow.
# Get the process id & try to terminate it gracefulypid = p.pid()p.terminate()# Check if the process has really terminated & force kill if not.try: os.kill(pid, 0) p.kill() print "Forced kill"except OSError, e: print "Terminated gracefully"
聯(lián)系客服