Merits of replacing bash with python

Martin v. Loewis martin at v.loewis.de
Sun May 19 15:43:56 EDT 2002


"Kevin Davies" <davies at jkevin.freeserve.co.uk> writes:

> I am pretty new to python and am looking for some good reasons to
> replace bash with python.
>  
> I can see already that python is pretty much executable pseudocode and
> is OO.
>  
> Can anyone give further insight?

For writing scripts, I'd give the following reasons why writing Python
is better than writing bash:

- more stuff is built-in; you don't need to create new processes
- execution of Python code is faster than bash's interpretation
- Python gives better error messages in case of problems
- Python exposes system functionality that might not be available
  as a utility (e.g. newgrp to a numeric group)
- Python exposes additional libraries not available in shell (sockets,
  GUIs, dbm, etc)

For interactive use, I would not recommend to replace bash (except,
perhaps, with zsh :-)

Regards,
Martin




More information about the Python-list mailing list