I have this script :
And it does say 'This is parm number (parm)' And it does print Child is (pid). Im confused as to how this works though. How is the pid of os.fork() == 0? Whenever I run os.fork() from the interpreter it is never 0......Code:while True: parm += 1 pid = os.fork() if pid == 0: os.execlp('espeak', 'espeak','this is parm number'+str(parm)) assert False, 'error starting program' else: print('Child is',pid) if input() == 'q' : break
Bookmarks