how do I know when popen() finishes?

jschmitt at vmlabs.com jschmitt at vmlabs.com
Wed Oct 11 13:48:38 EDT 2000


Thanks for the tip.

I thought that with the advent of Python 2.0, this stuff should work
under Windows as well.  In Python 1.5.2 I saw this disclaimer and the
recommendation of using Python 2.0.  What would you use under Windows
instead?

John
PS email to bragib at my-deja.com bounces.

In article <8s1nn2$4co$1 at nnrp1.deja.com>,
  bragib at my-deja.com wrote:
> John:
>
> Typically I read from popen like this:
> proc = os.popen( 'busyprogram' )
> while 1:
>     line = proc.readline()
>     if line:
>         print line
>     else:
>         break
>
> Bragi
>
> Note that popen is only for UNIX platforms.
>
> In article <8s0gts$767$1 at nnrp1.deja.com>,
>   jschmitt at vmlabs.com wrote:
> > I'm using Python 2.0b2 on Wind2000.
> >
> > If I do something like
> >
> > import os
> > f = os.popen( 'busyprogram' )
> >
> > how do I retrieve all the output that busyprogram produces when
> > busyprogram finishes?  Do I busy wait on f.read(), ie, wait for end
of
> > file?  Does f.close() do the same thing as pclose(f)?
> >
> > Thanks.
> >
> > John
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
> >
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list