Migrating to perl?

Skip Montanaro skip at mojam.com
Thu Jan 4 23:59:28 EST 2001


    Joel> Are the modules and add-ons as good as perl (ie, Database -- I'm
    Joel> primarily interested in MySQL, CGI, Graphics).  

I use MySQL all the time from Python.  It's pretty straightforward:

    import MySQLdb
    conn = MySQLdb.Connection(...)
    c = conn.cursor()
    c.execute("select id,name from performers where name like "Paul%")
    for (pid,name) in c.fetchall():
        print pid, name

There is a CGI module that's also fairly easy to use, though it is
undergoing some close scrutiny by the experts to see if it can be improved
upon.  There are also a number of CGI replacements like FastCGI, PyApache,
mod_python and mod_snake (the last three being mod_perl analogs).

"Graphics" covers a multitude of things, so I can only guess what you might
be interested in.  There are Python bindings for VTK
(http://www.kitware.com/) if you are looking for sci-viz and 3d rendering
sorts of things.  I believe there is a gnuplot interface module floating
around.  PythonWare (http://www.pythonware.com/) developed and distributes
PIL (the Python Imaging Library).  I believe there's something called (I
think) Piddle for doing device-indepndent 2d stuff.

Python's infrastructure for module distribution and installation is not as
mature as Perl's CPAN, but there you can search the Vaults of Parnassus
(http://www.vex.net/parnassus/) for third-party modules and there are
packages like distutils that are moving things in the right direction.  The
vast majority are easily installed.

Python is also somewhat more portable that Perl.  There are fully
functioning Windows and Mac ports.  The lag time between the release of a
new Unix version and corresponding Windows and Mac versions is pretty short
(generally a couple weeks to a month at most).

Your comment about Perls multitude of contexts really rings true with me.  I
use Perl in the guise of Mason these days to maintain the Mojam.com website.
(Mason is great, by the way.  I just wish it used Python. ;-) A couple weeks
ago I thought I had all the reference stuff figured out, but then this
morning it all came crashing down on me (again).  Ah well, back to the
perlref manpage...

-- 
Skip Montanaro (skip at mojam.com)
Support the Mojam.com Affiliates Program: http://www.mojam.com/affl/
(847)971-7098




More information about the Python-list mailing list