Why use Python instead of Perl?

Gerhard Häring gerhard.haering at opus-gmbh.net
Wed Feb 5 10:50:39 EST 2003


walterbyrd <walterbyrd at iname.com> wrote:
> I am learning some perl, I don't know any python. I think perl is a
> butt-ugly language, but perl does seem to be functional. Can anybody
> answer a few questions about python for me?
>  
> 1) Is python good for system administration tasks?
> 2) Is python good for web development?
> 3) Does python interact well with MySQL?

Perfect. Perfect. Sure.

> 4) Do many web-hosts allow scripts to be written in python?

Much less than Perl or PHP, but still quite some. See
http://www.python.org/cgi-bin/moinmoin/PythonHosting for a few that are known
to support Python.

> Tons of dirt-cheap web-hosts have perl scripting, what about python?

> 5) If I know perl, is there any reason to learn python?

I hardly know any Perl (I turned away in disgust when I saw how functions parse
their arguments). Python programs tend to be very readable, yet concise -
that's because of the nature of the language. It's still possible to create
overly clever hacks, but you'll have to try a little harder to create
unmaintainable code than in certain other languages ;-)

But Python vs. Perl has been discussed quite often in the past here, so I'll
just point you to some pages at python.org:

What is Python?                 http://python.org/doc/Summary.html
Python tutorial:                http://python.org/doc/current/tut/tut.html

Btw. Python can be learnt really quick! I wrote my first Python in two hours,
*including* reading the tutorial :-) It involved pulling certain stuff out of
the cache directory of a HTTP proxy server.

> 6) For what is python best suited? 

For almost anything. See http://www.python.org/psa/Users.html for what
Python is used for in business. This list seems rather outdated, however.

> I have programmed in over a dozen languages. I am reluctant to learn
> more. I have been learning perl, because it seems to be the only language
> that does all that stuff I have mentioned in my questions.

If you really know overy dozen languages, then you should be able to learn
enough Python in an afternoon or so to decide wether you like it or not :-)

-- Gerhard




More information about the Python-list mailing list