Tspostat in python. Flexible and incremental
Samo Penic
2018-05-07 14dfe4c2fd8c4580311d16709b7922f88f2983c1
Merge branch 'master' of ssh://git.penic.eu:29418/trisurf/trisurf-poststat
1 files added
20 ■■■■■ changed files
pipe.py 20 ●●●●● patch | view | raw | blame | history
pipe.py
New file
@@ -0,0 +1,20 @@
import os
import errno
import time
FIFO = 'mypipe'
try:
    os.mkfifo(FIFO)
except OSError as oe:
    if oe.errno != errno.EEXIST:
        raise
print("Opening FIFO...")
with open(FIFO) as fifo:
    print("FIFO opened")
    while True:
        data = fifo.read()
        if len(data) == 0:
            print("Writer closed")
            break
        print('Read: "{0}"'.format(data))