ActivePython/IIS Request Concurrency

Robert Brewer fumanchu at amor.org
Mon Oct 4 14:33:12 EDT 2004


Erik Rose wrote:
> Robert Brewer wrote:
> 
> > Insanity is in the mind's eye of the beholder. ;) All I can 
> tell you is
> > that I don't have that problem. But I'm not using 
> ActivePython, just 
> > IIS
> > + pywin32. My first thought was that the "application protection"
> > setting in IIS (process isolation, essentially) might be 
> the culprit,
> > but I tried all three settings without any difficulties on your 
> > script. :(
> 
> :(? More like :-D! I'm not particularly in love with ActivePython; 
> rather, I thought it was the only solution for ASP-embedded Python. 
> Reading a little about pywin32, I see this allusion in one of its 
> source distributions' readmes (pywin32-202/com/win32com/readme.htm):
> 
> "Python continues to work fine as an Active Scripting Engine in all 
> other applications, including Windows Scripting Host, and ASP."
> 
> My stars! Could it be that pywin32 is sufficient to allow Python as a 
> full-fledged ASP language? Is this how you're using it, i.e. not as a 
> CGI or anything? If it works for you, I'm perfectly happy (ecstatic, 
> actually) to match my setup to yours.

It's sufficient. :) Check out
http://www.4guysfromrolla.com/webtech/082201-1.shtml for a good intro to
using pywin32 for ASP.

FWIW, I don't use ASP for anything more than an envelope for "real"
Python scripts. The extent of my Python-in-ASP looks like:

<%@Language=Python%>
<%
from cation.html.uiasp import UserInterfaceASP
import mcontrol

ui = UserInterfaceASP(mcontrol.application)
ui.sandbox = mcontrol.arena.new_sandbox()
ui.request(Request, Response)
ui.sandbox.flush_all()
%>

All the heavy lifting is done by my "cation" web framework. You can do
the same with almost any Python web framework, I'd bet. Such a scheme
can keep you from tearing your hair out trying to mix Python indentation
rules with HTML's lack of such.


Robert Brewer
MIS
Amor Ministries
fumanchu at amor.org



More information about the Python-list mailing list