Python 2.1.1 ASP/Response object does not HONOR Response.End()

Jim Abrams jim at publishingresources.com
Wed Jul 25 16:24:14 EDT 2001


"Joe Salmeri" <JoeSalmeri at home.com> wrote in
<42E77.41650$Ek3.15221529 at news1.rdc1.md.home.com>: 

>Thanks Jim.
>
>Are all the methods supposed to be lower case.
>
>I'm using the ASP documentation at
>http://www.w3schools.com/asp/asp_ref_response.asp whichs shows the
>method names with an upper case first letter.  I just did a test and
>Response.Write and Response.write BOTH work.  I wonder why
>Response.End() doesn't raise an AttributeError?
>
>Do you have any good sources for documentation using Python and ASP? 
>There do not seem to be many and those that I have found are minimal at
>best. 

Unfortunately I don't have any good documentation sources, and most of what 
I know was learned the hard way. 

If you know ASP and have a good 'feel' for Python you have a good start. 
Just think how Python works and try applying it to ASP and things usually 
fell into place for me.

Here are a bunch of other things to look out for. I wonder... is there a 
Python in ASP faq? Maybe it's time to start one.

Session.SetValue(key, val)
Application.SetValue(key, val)
Is how you set Session and Application vars from Python.

Modules are cached and need to be explicitly reloaded. i.e. reload(module)

global.asa: You need some VBscript first, then the Python one will work.
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
function noOp()
end function
</SCRIPT>

<script language=Python runat=server>
def Application_OnStart():
	pass #stuff
</SCRIPT>


You can't mix HTML in code blocks.
<%if 1:%>
  <tags>
<%else:%>
  <tags>

This doesn't work for obvious reasons. Check out HTMLgen for some easy 
alternatives.

And there's a bunch more I can't think of right now, but go check through 
the c.l.py archives for ASP and lots of good info will emerge.




More information about the Python-list mailing list