script files with python (instead of tcsh/bash)?

andrew cooke andrew at acooke.org
Sat Mar 21 15:06:37 EDT 2009


Esmail wrote:
> Peter Pearson wrote:
>> On Sat, 21 Mar 2009 09:26:02 -0400, Esmail <ebonak at hotmail.com> wrote:
>>> I am wondering if anyone is using python to write script files?
>> If it can be done in a few simple lines of shell script,
>> fine: make it a shell script. But if it's more complex than
>> that, Python is clearer.  Just my two cents.
> Yes, I agree .. the complexity of the script(s) have evolved to the
> stage that I was thinking moving to Python makes sense (if that's
> something
> that Python is suitable for - which it appears it is :-)

just a quick data point here - i once wrote a "blog engine" (that's a
rather grand name for some scripts that convert emails to web pages) in
bash.  i later rewrote it in python, but it turned out to be a similar
size and complexity.  now granted, i made the original design so that it
played to bash's strengths, but even so i was quite surprised.  it brought
home to me that bash really is quite powerful.

so you might be better spending the time improving your bash skills than
doing what will be largely drudge work in a language you already know.

andrew

ps i just checked my notes - http://www.acooke.org/cute/Computeisb0.html -
and the one obvious advantage of python that was the improvement in speed.





More information about the Python-list mailing list