a way to keep the Python interpreter in memory?

Skip Montanaro skip at mojam.com
Tue Sep 19 11:44:25 EDT 2000


    RA> When Python is attached to a website, does it function like Perl or
    RA> the JVM?  Meaning is a Python interpreter kept in memory at all
    RA> times?"

As usual, it depends.  If you use plain old CGI, no, the Python interpreter
is invoked for each CGI request.  There are a number of Apache modules
(mod_python, PyApache and mod_snake that I'm aware of) that allow you to
embed a Python interpreter into Apache.  Check the newsgroup archives for
references.  You can also use Zope, or just the ZServer/Medusa to run a web
server written in Python.  Zope is a full-blown web application server.
ZServer is just the web server component, built atop Medusa.  Some URLs for
this stuff:

    http://www.zope.org/
    http://www.nightmare.com/medusa/

(Note, BTW, that mod_perl is available to embed a Perl interpreter into
Apache, so there's no reason to use Perl and suffer with interpreter startup
overhead there.)

Conclusion: If the only thing that favors Java servlets over Python or Perl
is the startup time, you need to reconsider the results of the
evaluation... ;-)

-- 
Skip Montanaro (skip at mojam.com)
http://www.mojam.com/
http://www.musi-cal.com/



More information about the Python-list mailing list