Anybody can help on this?
Bo Vandenberg
bosahv at netscapenospam.net
Mon Feb 25 04:24:16 EST 2002
Thanks from the lurkers :)
"Jeff Shannon" <jeff at ccvcorp.com> wrote in message
news:3C768944.59BDD67E at ccvcorp.com...
>
> husam wrote:
>
> > >>> passout,passin=os.popen2("/home/husam/profit_1/profit")
> > # Also tried calling this with "popen2.popen2()" no go.
> > ....
> > >>> passin.read()
> > # Here it hangs, the only way to stop it is by pressing: ctrl+c
>
> Yes, just to make it explicit, this will block until the pipe closes,
i.e.,
> the external program terminates. This can be a long time, depending on
the
> external program. :)
>
> This can be avoided by reading single lines (which blocks until a full
line
> is available), or by specifying a number of bytes to read (which blocks
> until that many bytes are available). I think there is also an optional
> timeout, but it's been a while since I poked around with popen*() ...
>
> (I see that you already found a solution, but I wanted to post this for
the
> benefit of anyone else who might be following along...)
>
> Jeff Shannon
> Technician/Programmer
> Credit International
>
>
More information about the Python-list
mailing list