Work with "named pipe" in python

0

I am trying to write a sript python to read from a file and send the output to a named pipe or named pipe. Unlike the standard pipe, the named pipe persists in the system and not in memory.

So far I have seen that with popen you can work with standard pipes and take the inputs / outputs of systems but I can not walk with the aforementioned named pipe.

    
asked by elMor3no 10.03.2017 в 21:21
source

1 answer

1

I answer myself ... Named Pipe in Linux with a Python Example - roman10 link

This url explains how reading and writing works using a named pipe.

The detail is that for each writing the pipe must be opened and closed.

py1.py

pipe = open('psquid', 'w') 
pipe.write('hola')
pipe.close()

py2.py

pipe2 = open('psquid', 'r')
pipe2.read()
'hola'

Greetings

    
answered by 10.03.2017 в 22:31