Python, ASP and global.asa

Syver Enstad syver at NOSPAMcyberwatcher.com
Fri Feb 2 15:41:37 EST 2001


Hi Steve, I've found a couple of solutions to your problem.

It seems that IIS won't tolerate python script in global.asa if the
applications scripting language isn't set to python.

There are however a way to get python code to execute in global.asa without
switching the default language of the application and that is to provide
a script block for the default language in global.asa.

example global.asa if the default scripting language for the application was
Jscript


<script language=Jscript runat=server>
function dummy()
{ 
}
</script>


<script language=Python runat=server>
def Session_OnStart():
  import time
  Session.Contents['OnStart'] =  time.ctime(time.time())
</script>

If the default language was VB you'll have to have a Vb script block there instead. So to be safe you'll have to have both. There seems to be no difference in the order the script blocks appear in.






<spbridge at my-deja.com> wrote in message news:95bl24$ese$1 at nnrp1.deja.com...
> As a relative newcomer to Python, I have to
> Develop for ASP during a
> transition to Apache / Linux.
> My Problem is that Python Scripts in the
> global.asa always bring an
> "indentation error" although there is definately
> none there.
> Does anyone have any suggestions?
> 
> Steve Bridge
> sbridge at workways-gmbh.de
> 
> 
> Sent via Deja.com
> http://www.deja.com/






More information about the Python-list mailing list