Using popen interactively

Joe Mason joe at notcharles.ca
Fri Jun 7 15:36:26 EDT 2002


In article <adqm9k$22u6$1 at nntp6.u.washington.edu>, Donn Cave wrote:
> Right.  I expect you'd do better to throw away the file objects
> popen2 makes for you, and use the pipe file descriptors directly.
> Instead of
>     infile = app.fromchild
>     ...
>         line = infile.readline()
> say
>     infile = app.fromchild.fileno()
>     ...
>         data = posix.read(infile, 8192)
>         #  split into lines if you care

Ah!  Light begins to dawn.  Thank you very much.

Joe



More information about the Python-list mailing list