anonymous pipes and threadsnot processesthis version works on windows import ostimethreading def child(pipeout)zzz while truetime sleep(zzzmsg ('spam % dzzzencode(os write(pipeoutmsgzzz (zzz+ make parent wait pipes are binary bytes send to parent goto after def parent(pipein)while trueline os read(pipein blocks until data sent print('parent % got [%sat % (os getpid()linetime time())pipeinpipeout os pipe(threading thread(target=childargs=(pipeout,)start(parent(pipeinsince threads work on standard windows pythonthis script does too the output is similar herebut the speakers are in-process threadsnot processes (note that because of its simple-minded infinite loopsat least one of its threads may not die on ctrl- -on windows you may need to use task manager to kill the python exe process running this script or close its window to exit) :\pp \system\processespipe-thread py parent got [ 'spam 'at parent got [ 'spam 'at parent got [ 'spam 'at parent got [ 'spam 'at parent got [ 'spam 'at parent got [ 'spam 'at parent got [ 'spam 'at parent got [ 'spam 'at etc ctrl- or task manager to exit bidirectional ipc with anonymous pipes pipes normally let data flow in only one direction--one side is inputone is output what if you need your programs to talk back and forththoughfor exampleone program might send another request for information and then wait for that information to be sent back single pipe can' generally handle such bidirectional conversationsbut two pipes can one pipe can be used to pass requests to program and another can be used to ship replies back to the requestor this really does have real-world applications for instancei once added gui interface to command-line debugger for -like programming language by connecting two processes with pipes this way the gui ran as separate process that constructed and parallel system tools