
On Aug 4, 2004, at 4:03 PM, Chris McDonough wrote:
On Wed, 2004-08-04 at 15:01, Peter Astrand wrote:
So, there is no problem with using select() on pipes when communicating with a subprocess. It works great. Take a look at (my) process.py's communicate() method for some inspiration.
I've actually looked at it and it's quite nice, but it doesn't do one thing that I'd like to see as part of a process stdlib library. The use case I'm thinking of is one where a long-running program needs to monitor the output of many other potentially long-running processes, doing other things in the meantime. This kind of program tends to use select as a part of a mainloop where there might be other things going on (like handling network communications to/from sockets, updating a GUI, etc). Also, the output from child stderr and stdout potentially never end because the child process(es) may never end.
Twisted handles this quite well already. The stdlib doesn't really do much to support this style of programming. -bob