1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
import os import sys import time # Create new process pid = os.fork() # Print text c = 'p' if pid == 0 else 'c' if pid == 0: sys.exit(0) while True: time.sleep(1) sys.stderr.write(c)