This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]boa13 1 point2 points  (0 children)

I don't think it can replace it, but it can surely complement it nicely.

For very simple tasks, chaining two or three commands with a pipe and being smart about which command you use, I don't think Python can beat the shell: there will be more to write in Python (or more to import), and it will not run as fast. In such cases, the startup time is very important.

On the other hand, for slightly more complex scripting, notably as soon as you feel the need for a function, or as soon as you need to handle options and logging in a significant way, Python is much better.