"shell-commands" and python!

Erik Max Francis max at alcyone.com
Sat Sep 22 04:25:07 CEST 2001


Greg Weeks wrote:

> With very few exceptions, Python handles basic programming tasks as or
> more
> conveniently than other languages.  With so few exceptions, why not
> shoot
> for zero exceptions?

Because Python is not a shell script, and should not strive to be like
them.  It's a different language.

Furthermore, many of the cases you talk about don't make sense.  Shell
script redirections, pipes, etc. all assume there are sensible streams
of data moving around.  That makes perfect for a shell, where they
organize programs being run and their input and output, but what does it
mean for Python code in general where no such streams exist?

> Besides, as a practical matter, I'd rather not have to evaluate every
> programming task as a choice between Ksh and Python.

I think you're getting One Hammer Syndrome.  Why not use both, each for
the purposes at which they're best suited?

Besides, when you're running the Python scripts, you've got access to
those all snazzy shell operators that you want to use.  Just use them
there.

> Finally, regarding program invocation with redirection and such, Perl
> does
> a slightly better job than Python, and that's never nice.

That's not surprising, since Perl has its heritage in shell scripts. 
Perl had its beginnigs as a unification of shell scripting and other
basic UNIX utilities like grep and sed.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ You must surely know / If man made Heaven, then man made Hell
\__/ Level 42
    Interstelen / http://www.interstelen.com/
 A multiplayer, strategic, turn-based Web game on an interstellar scale.



More information about the Python-list mailing list