"shell-commands" and python!

Paul Moore gustav at morpheus.demon.co.uk
Sat Sep 22 10:27:24 EDT 2001


On Fri, 21 Sep 2001 19:59:54 -0400 (EDT), Ignacio Vazquez-Abrams
<ignacio at openservices.net> wrote:

>On 21 Sep 2001, Martijn Faassen wrote:
>
>> That does not mean necessarily it is possible to solve the perceived
>> shortcomings; the proposed solutions may not be desirable for other reasons
>> (obscuring matters, for instance). Python in this respect is more careful
>> to preserve internal coherence than Perl.
>>
>> But it does the language and the community no harm to discuss these issues.
>> Who knows, we may learn something. It is one way to improve your programming
>> language, too.
>
>Ease of redirection and backgrounding has not been a part of Python in the
>past, and we have to wonder whether adding those features is an actual
>improvement or just a nicety.
>
>In my mind it's just a nicety. If my needs are better met by another tool, I
>have absolutely no qualms about using that tool.

While I don't have a problem with the philosophy of using the right tool for the
job, I think there is a fundamental "type of task" here - namely, pipe-type
plumbing of subprocesses - which is fairly common. It would not do any harm to
have a relatively simple way of doing this in Python.

However, this does *not* mean that there's any need to change anything - it's an
ideal task for a new module (like popen/fork and friends, but higher level). To
answer the original poster's question in a different way, I am not awaer of such
a module which currently exists, but I imagine that designing and writing such a
module would be an interesting, and generally useful task. Heck, i may even have
a look at it myself...

BTW, for people not averse to stealing design ideas from "the opposition",
there's a Perl module on CPAN - IPC::Run, I believe, which does this sort of
thing.

Paul.



More information about the Python-list mailing list