"shell-commands" and python!

Ignacio Vazquez-Abrams ignacio at openservices.net
Sat Sep 22 01:45:34 EDT 2001


On Sat, 22 Sep 2001, Donn Cave wrote:

> Quoth Ignacio Vazquez-Abrams <ignacio at openservices.net>:
> | On Fri, 21 Sep 2001, Greg Weeks wrote:
> |> Ignacio Vazquez-Abrams (ignacio at openservices.net) wrote:
> |>: On Fri, 21 Sep 2001, Greg Weeks wrote:
> |>:
> |>: >     <  >  >>  2>  2>>  2>&1		# REDIRECTION
> |>:
> |>: popen(..., 'w'), popen(..., 'r'), popen(..., 'r'), popen3(...),
> |>: popen3(...), popen4(...)
> |>
> |> This has a problem.  For example, to redirect output to a file, I need to
> |> read it from the pipe stream and write it to the file stream myself.  If I
> |> want this to happen as the text is generated, I need a separate thread to
> |> "weld" together the pipe stream and the file stream.  That is a good deal
> |> clunkier (and less efficient) than is available using Ksh.
> |
> | Would you like some cheese with that whine?
> |
> | If you feel that ksh is the correct tool for the job, then by all means feel
> | free to use ksh. If you would rather use Python for it, then use Python and
> | stop complaining.
>
> You know, you don't have to answer every question to comp.lang.python.
> When you do choose to answer one, please don't abuse the original poster
> when he points out the deficiencies of your answer.

Oh come off it. His response is the equivalent of "but... but... Python should
be like ksh!" No it should not. It does not have the same purpose, therefore
it should not have the same constructs.

I apologize if I came off as being abusive, but I'm sick and tired of hearing
"Python should be more like [language of choice]" when the only justification
is so that things that can be done in [language of choice] can be done just as
efficiently (or inefficiently, for that matter) in Python. If you should be
using [language of choice] for a given task, then use [language of choice].
Don't go polluting Python "just because".

-- 
Ignacio Vazquez-Abrams  <ignacio at openservices.net>





More information about the Python-list mailing list