Is there a way to check to see if a pid corresponds to a valid process? I'm getting a pid from a different source other than from os.getpid()
and I need to check to see if a process with that pid doesn't exist on the machine.
I need it to be available in Unix and Windows. I'm also checking to see if the PID is NOT in use.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…