os.popen

P at draigBrady.com P at draigBrady.com
Thu Feb 19 16:02:48 CET 2004


Cameron Laird wrote:
> 1.  Why 
>       sh ./ping.sh ...
>     rather than
>       ./ping.sh ...
>     ?

Maybe he didn't make ping.sh executable for some reason.
Not relevant to this discussion.

> 2.  For more typical processes that launch and run to 
>     completion, yes, to the best of my knowledge, it 
>     *is* feasible to simplify 
>       op = os.popen(command)
>       op.read()
>       op.close()
>     to just
>       op = os.popen(command)
>       op.close()

iff the command doesn't fill the buffer.
If it does then it will not run to completion.

-- 
Pádraig Brady - http://www.pixelbeat.org




More information about the Python-list mailing list