I'm trying to simply read from stdin using codecs using the code below
import codecs
ins = codecs.getreader('utf-8')(sys.stdin, 'replace')
for l in ins:
print l
I have another script that writes to stdout in burst of small data. I need my script to process the data after each burst. However, codecs seems to buffer the data. That means that lines that are written to stdout don't immediately show up in my reader code above. Is there a parameter that I can set to prevent the buffering?
Thanks!