[mod_python] importing from a PSP file

Lee E. Brown Administrator at leebrown.org
Thu Jan 6 11:31:09 EST 2005


Greetings!

I don't know if this will help you or not, but mod_python actually uses 
subinterpreters, each of which have their own namespace separate from the 
main interpreter.

The default behavior is to create a subinterpreter for each virtual host on 
the server.  However, you can use the PythonInterpPerDirectory directive so 
that each directory accessed gets its own namespace based on the absolute 
path of the directory being accessed.  Or you can use the 
PythonInterpPerDirective directive to create a namespace based on the 
directory where the Python*Handler was found.  You can also use the 
PythonInterpreter directive to force the namespace to be based on a supplied 
string.

If you use one of the above means to give each developer his/her own 
subinterpreter, you can then initialize a proper sys.path statement for each 
interpreter allowing access to the needed files without polluting other 
developer's namespaces or overflowing the main interpreter's sys.path 
variable.

Best Regards,
Lee E. Brown

----- Original Message ----- 
From: "Simon Wittber" <simonwittber at gmail.com>
Cc: <mod_python at modpython.org>
Sent: Thursday, January 06, 2005 10:38 AM
Subject: Re: [mod_python] importing from a PSP file


> We're all actually sharing the same interpreter, which I've just come
> to understand!



More information about the Mod_python mailing list