import os, sys, time
code = os.fork()
if (code == 0):
    for j in range(6):
        time.sleep(1)
        print ('child still alive, process ID: ', os.getpid())
    # after 6 seconds, terminate the child
    sys.exit(1)
else:
    # don't let the parent wait
    for i in range(12):
        print ('parent still alive, process ID ', os.getpid())
        time.sleep(1)
