import os, sysdef counter(count): for i in range(count): print '[%s] => %s' % (os.getpid(), i)for i in range(10): pid = os.fork() if pid != 0: print 'Process %d spawned' % pid else: counter(100) sys.exit()print 'Main process exiting.'
Name (required)
email (will not be published) (required)
Website