subprocess -popen - reading stdout from child - hangs

gregpinero at gmail.com gregpinero at gmail.com
Mon Sep 24 17:22:40 EDT 2007


On Sep 23, 2:58 am, Karthik Gurusamy <kar1... at gmail.com> wrote:
> On Sep 22, 8:28 pm, "gregpin... at gmail.com" <gregpin... at gmail.com>
> wrote:
>
> > Let's say I have this Python file called loop.py:
>
> > import sys
> > print 'hi'
> > sys.stdout.flush()
>
> Add sys.stdout.close()
>

Adding sys.stdout.close() and removing sys.stdout.flush() seems to
make it work.  But can the while loop still use sys.stdout later on?
Do I have to reopen it?

Thanks,

Greg





More information about the Python-list mailing list