help!! getting output from another process line by line, using popen

cout cout at
Fri Jan 17 11:06:01 CET 2003


There are 2 python scripts, one is to print out the output(,
the other is supposed to get std output from line by line.
However, it only get all the result after 40 seconds. Not during the
executing process. Any ideas?
#! /usr/bin/python

import time

for i in range(1,20,1):
         print i
#! /usr/bin/python

import os
import sys, string

handle = os.popen(cmd, 'r', 1)
for line in handle:
     print line,

More information about the Python-list mailing list