Just for fun, I thought I'd create some zombie processes using Linux. (This will probably only work on POSIX-compliant operating systems. I don't know that Windows has zombies.)
I started with the C code given here: https://en.wikipedia.org/wiki/Zombie_process#Examples and re-wrote it into Python: steve@runes:~$ cat zombie.py import os, sys, time pids = [None]*10 for i in range(9, -1, -1): pids[i] = os.fork() if pids[i] == 0: time.sleep(i+1) os._exit(0) for i in range(9, -1, -1): os.waitpid(pids[i], 0) If you run that script on Linux, and watch the process list using (say) top, you will see the number of zombies grow up to a maximum of nine, then drop back down to (hopefully) zero. -- Steve -- https://mail.python.org/mailman/listinfo/python-list