in pythonnamed pipe files are created with the os mkfifo callwhich is available today on unix-like platformsincluding cygwin' python on windowsbut is not currently available in standard windows python this call creates only the external filethoughto send and receive data through fifoit must be opened and processed as if it were standard file to illustrateexample - is derivation of the pipe py script listed in example - but rewritten here to use fifos rather than anonymous pipes much like pipe pythis script opens the fifo using os open in the child for low-level byte string accessbut with the open built-in in the parent to treat the pipe as textin generaleither end may use either technique to treat the pipe' data as bytes or text example - pp \system\processes\pipefifo py ""named pipesos mkfifo is not available on windows (without cygwin)there is no reason to fork heresince fifo file pipes are external to processes--shared fds in parent/child processes are irrelevent""import ostimesys fifoname '/tmp/pipefifodef child()pipeout os open(fifonameos o_wronlyzzz while truetime sleep(zzzmsg ('spam % \nzzzencode(os write(pipeoutmsgzzz (zzz+ must open same name open fifo pipe file as fd binary as opened here def parent()pipein open(fifoname' 'open fifo as text file object while trueline pipein readline()[:- blocks until data sent print('parent % got "%sat % (os getpid()linetime time())if __name__ ='__main__'if not os path exists(fifoname)os mkfifo(fifonameif len(sys argv= parent(elsechild(create named pipe file run as parent if no args else run as child process because the fifo exists independently of both parent and childthere' no reason to fork here the child may be started independently of the parent as long as it opens fifo file by the same name herefor instanceon cygwin the parent is started in one shell interprocess communication