select() vs. pipes (was [Python-Dev] Re: PEP 324 (process module))
Moore, Paul
Paul.Moore at atosorigin.com
Thu Aug 5 11:18:25 CEST 2004
From: Chris McDonough
> 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
I have a couple of other use cases, as well.
1. Manage an interactive subprocess, sending it input and reading
output in "chunks". This is an expect-like activity in some
ways: I use it to wrap an alternative UI round an interactive
command line process. I suspect Trent's ProcessProxy would
help with this - must check.
2. Run a command with no input, and get its output back, like the
shell backtick operator. Errors in the command should appear
as exceptions.
3. Filter a string through an external command - the interact()
method handles this, but again I'd like errors to appear as
exceptions.
To some extent, (2) and (3) are simple "helper" functions round the
existing methods, but I believe such helpers would be useful. And
the "convert subcommand error to exception" code is non-trivial,
and hence useful to encapsulate in the library.
This is getting pretty off-topic for python-dev. Is there any value
in setting up a list/SIG for discussing the design of a stdlib
process module?
Paul.
__________________________________________________________________________
This e-mail and the documents attached are confidential and intended
solely for the addressee; it may also be privileged. If you receive this
e-mail in error, please notify the sender immediately and destroy it.
As its integrity cannot be secured on the Internet, the Atos Origin group
liability cannot be triggered for the message content. Although the
sender endeavours to maintain a computer virus-free network, the sender
does not warrant that this transmission is virus-free and will not be
liable for any damages resulting from any virus transmitted.
__________________________________________________________________________
More information about the Python-Dev
mailing list