Linked by Eugenia Loli-Queru on Fri 14th Sep 2007 23:08 UTC
General Development As a system administrator, you run across numerous challenges and problems. Managing users, disk space, processes, devices, and backups can cause many system administrators to lose their hair, good humor, or sanity. Shell scripts can help, but they often have frustrating limitations. This is where a full-featured scripting language, such as Python, can turn a tedious task into an easy one. Python is a scripting language that looks like it was made for system administrators.
Thread beginning with comment 271443
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[2]: Not quite so fast cowboy
by SEJeff on Sat 15th Sep 2007 02:26 UTC in reply to "RE: Not quite so fast cowboy"
SEJeff
Member since:
2005-11-05

Use the best tool for the job. In text processing, perl beats python.

In python, a regexp is a second class object. In perl, a regexp is a first class object. Anyone with proficiency in *both* languages will agree with you.

I love python, but it doesn't make sense for managing "Unix" systems. If the title of the article was, "Why You Should Adopt Python to Manage Linux Systems", I would agree.

You can't always install something as large as python due to business processes or technical requirements. When your company has been managing systems a similar way for 10 years, they might not like to change. (Not reflective of my current job, but true for my previous one.)

Edited 2007-09-15 02:30

Reply Parent Bookmark Score: 3

RE[3]: Not quite so fast cowboy
by japh on Sat 15th Sep 2007 11:05 in reply to "RE[2]: Not quite so fast cowboy"
japh Member since:
2005-11-11

"In python, a regexp is a second class object. In perl, a regexp is a first class object. Anyone with proficiency in *both* languages will agree with you."

Well, if you consider regexp build into the syntax a better solution, then I guess perl is ahead. I don't find Pythons regexp hard to use and I like the design where you don't cram things like regexp into the language, but keep it in a module.
It will make me type a little bit more, but it also means I usually understand my code better than in perl anyway.

Having said that, I'm not using Python for system administration much. The simple things that I need to do can be done in shell scripts just as well as in Python. The times I use Python is when things should run automatically and a "Permission denied" printed to stderr just isn't enough error handling.

Reply Parent Bookmark Score: 1

SEJeff Member since:
2005-11-05

Python has exception handling and perl doesn't. You have just hit on an area that Python tromps perl about a millionfold. Python's OO is also not a pain to deal with as it is truly integrated into the language.

That said, Linux systems administration is mostly just dealing with text files and text streams. For that alone, perl will always beat python.

Reply Parent Bookmark Score: 2