Where is the buffer in this following ... and how do I turn it off?
I am writing out to stdout in a python program like so:
for line in sys.stdin:
print line
There is some buffering going on here:
tail -f data.txt | grep -e APL | python -u Interpret.py
I tried the following to shake off possible buffering ... with no luck:
To benchmark my expectations, I tried:
tail -f data.txt | grep -e APL
This produces a steady flow of lines ... it surely is not as buffered as the python command.
So, how do I turn off buffering?
ANSWER: It turns out there is buffering on both ends of the pipe.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…