#!/usr/bin/python import os print "Start %s" % os.getpid() if os.fork(): print "parent %s" % os.getpid() else: print "child %s" % os.getpid() # expect to see "Start" appear only once, per run of this program