Python + Win32ALL + ASP = Problems accessing Request/Response/Session/Application objects

Mark Hammond mhammond at skippinet.com.au
Thu Jul 25 01:34:16 EDT 2002


Joe Salmeri wrote:

> Hopefully Mark Hammond will see this, I'm sure he will be able to provide
> the answer (he always does!)

OK :)

It is all a bit nasty I'm afraid.  In a nutshell, these objects are just 
COM objects that exist in some global namespace.  (They are actually 
pyscript.ScriptItem objects, added as globals in 
pyscript.PyScript.RegisterNamedItem())

Each "engine" has a global namespace.  The "engine" is defined by the 
application (ie, ASP), and "named items" along with the user specified 
"script code" are added to this engine.

ASP obviously could have many Python engines open at once - one for 
every different connection to a page with Python content.  Your external 
module may be used by any number of other ASP connection/scripts, so you 
really can't consider these script objects as "global" in any sense of 
the word.

So while you may be able to devise a scheme for yourself, there really 
isn't much the ActiveScripting framework can do to help - nothing here 
is "global", so nothing is exposed as such.

You could just pass the "ax" object around - it should have all the 
globals as attributes - eg, "ax.session" may work.

Mark.




More information about the Python-list mailing list