import thread
import os
import sys
import time
def proz():
if os.access('transport', os.F_OK):
os.system('rm -rf transport')
os.mkfifo('transport')
channel = open('transport','w',1)
for i in range(100):
channel.flush()
channel.write('data %i\n' %i)
time.sleep(.1)
channel.close()
def test():
thread.start_new_thread(self.proz,())
time.sleep(.1)
while not os.access('transport',os.R_OK):
pass
channel = open('transport','rw',1)
while 1:
line = channel.readline()
if not line:
break
print line
channel.close()
os.unlink('transport')