[Tutor] Using Python instead of VB in ASP with IIS

Sam Corder samus@feudalkingdoms.tzo.org
Wed, 16 May 2001 17:56:37 +0000


It sounds like Python is registered as an active scripting language since they run 
in IE.  Here is a very simple example script for asp.
<%@ LANGUAGE = Python%>
<%
Response.Write('Hi')
%>

You may want to turn off friendly error messages in IE.  Also if the simple script 
above works then it may be your code.  Turning off the friendly error messages 
should show you what actually blew up.  Another gotcha for python/asp is that code 
embedding like
<%
if something == 1:%>
this is a para with <%=    myvar%> code
<%
else:
    pass
%>
this is a para without embedded code.

Won't work because the asp engine doesn't transmit the white space in <%= %>to 
python.  I guess this has the advantage of keeping most of your code outside of the 
html.  I have a couple more complex examples if you want them.  We mainly use 
python and the Reportlab package to generate pdf reports and stream them down to 
the browser.

-Sam

kent@springfed.com, tutor@python.org wrote:
>
>My situation is:
>1) running Win2K Advanced Server
>2) installed ActiveState distribution
>3) ran python\win32comext\axscript\client\pyscript.py
>4) pages with <script language=3D"Python">=A0(i.e., client-side=
> Python) run
>correctly in IE
>5) ASP pages with <%@ Language=3DPython %>=A0always fail with error=
> 500 Server
>Error
>6) ASP pages with <SCRIPT RunAt=3DServer Language=3DPython>=A0blocks=
> always fail
>with error 500 Server Error
>-Sam
>kent@springfed.com, tutor@python.org wrote:
>>
>>Howdy,
>>Is there a convenient source of info on the
>>configuration required to allow server side
>>ASP pages to employ Python code?
>>Thanks,
>>Kent
>>-- Kent Tenney, kent@springfed.com on 05/16/2001
>>_______________________________________________
>>Tutor maillist  -  Tutor@python.org
>>http://mail.python.org/mailman/listinfo/tutor
>-- Kent Tenney, kent@springfed.com on 05/16/2001
>_______________________________________________
>Tutor maillist  -  Tutor@python.org
>http://mail.python.org/mailman/listinfo/tutor