I want to use os.mkfifo for simple communication between programs. I have a problem with reading from the fifo in a loop.
Consider this toy example, where I have a reade
You do not need to reopen the file repeatedly. You can use select to block until data is available.
with open(FIFO_PATH) as fifo: while True: select.select([fifo],[],[fifo]) data = fifo.read() do_work(data)
In this example you won't read EOF.