Why use Python instead of Perl?

Paul Rubin REPLY_TO_NEWSGROUP at NOT_EMAIL.INVALID
Wed Feb 5 20:02:41 CET 2003


walterbyrd at iname.com (walterbyrd) writes:
> 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?

That's a vague enough question to be able to say sure, why not?  

> 2) Is python good for web development?
>  
> 3) Does python interact well with MySQL?

Not out of the box.  There are third party modules that you have to
choose between for these functions.  Perl is in sort of the same
situation though the database situation is maybe a little more unified
(the Perl::DBI module) and there's a centralized place (CPAN) to get
extension modules.  You might also look at PHP, which does html
templating and has database interfaces included so you don't have to
download anything.

> 4) Do many web-hosts allow scripts to be written in python? Tons of
> dirt-cheap web-hosts have perl scripting, what about python?

There are some, but nowhere near as many as Perl or PHP.

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

Python is a much more civilized language.  I forgot almost everything
about Perl once I'd been using Python for a while.

> 6) For what is python best suited? 

I'd say: medium-sized development projects where runtime performance
isn't criical (i.e. many if not most projects).  For very small
projects you may have to spend too much time chasing down 3rd party
modules that the distribution maintainers didn't see fit to include
with the language.  For very large projects the limits of the language
and its implementation start to drag you down.  For projects in the
wide sweet spot in the middle, you really do get a pleasant speedup in
development.

> 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 just want to put up simple dynamic web sites with minimal fuss,
you might look at PHP.  It is VERY convenient for smaller projects.
However, its programming language gets painful to use once the
programs start getting big.




More information about the Python-list mailing list