S
Shaun Jackman
I'm reading from a tcpdump pipe. I want to receive one line from the
pipe as soon as its available from tcpdump. Something is buffering the
pipe though, so I am receiving nothing, then multiple lines in a big
batch. I thought this was the inherent buffering of next(), but it
affects readline too.
For example,
tcpdump = os.popen( 'sudo tcpdump', 'r')
both
while True: print tcpdump.next(),
and
while True: print tcpdump.readline(),
buffer mutiple lines before printing.
Please cc me in your reply. Thanks,
Shaun
pipe as soon as its available from tcpdump. Something is buffering the
pipe though, so I am receiving nothing, then multiple lines in a big
batch. I thought this was the inherent buffering of next(), but it
affects readline too.
For example,
tcpdump = os.popen( 'sudo tcpdump', 'r')
both
while True: print tcpdump.next(),
and
while True: print tcpdump.readline(),
buffer mutiple lines before printing.
Please cc me in your reply. Thanks,
Shaun