that showed up in the debugger' output stream pipe in effectthe gui acted like programmer typing commands at keyboard and client to the debugger server more generallyby spawning command-line programs with streams attached by pipessystems can add new interfaces to legacy programs in factwe'll see simple example of this sort of gui program structure in the module in example - demonstrates one way to apply this idea to link the input and output streams of two programs its spawn function forks new child program and connects the input and output streams of the parent to the output and input streams of the child that iswhen the parent reads from its standard inputit is reading text sent to the child' standard output when the parent writes to its standard outputit is sending data to the child' standard input the net effect is that the two independent programs communicate by speaking over their standard streams example - pp \system\processes\pipes py ""spawn child process/programconnect my stdin/stdout to child process' stdout/stdin--my reads and writes map to output and input streams of the spawned programmuch like tying together streams with subprocess module""import ossys def spawn(prog*args)stdinfd sys stdin fileno(stdoutfd sys stdout fileno(parentstdinchildstdout os pipe(childstdinparentstdout os pipe(pid os fork(if pidos close(childstdoutos close(childstdinos dup (parentstdinstdinfdos dup (parentstdoutstdoutfdelseos close(parentstdinos close(parentstdoutos dup (childstdinstdinfdos dup (childstdoutstdoutfdargs (prog,args os execvp(progargsassert false'execvp failed!pass prognamecmdline args get descriptors for streams normally stdin= stdout= make two ipc pipe channels pipe returns (inputfdoutoutfdmake copy of this process in parent process after forkclose child ends in parent my sys stdin copy pipe [ my sys stdout copy pipe [ in child process after forkclose parent ends in child my sys stdin copy pipe [ my sys stdout copy pipe [ new program in this process os exec call never returns here if __name__ ='__main__'interprocess communication