All pastes #196904 Raw Edit

Miscellany

public python v1 · immutable
·published 2006-10-10 23:25 UTC
rendered paste body
import ospid = os.fork()if pid > 0: # we are the parent! pid is nowthe pid of the child	os.waitpid(pid,0) #wait for our child - could simply use wait()	print "it's done"elif pid == 0: # we are the child, time to exec	os.execvp("grep",("grep","pid","fork.py")) # note that execvp uses the path, ymmv here