Re: python scripts with IIS



Adding the following lines before your print statement should do the trick. IIS complains about the headers, so adding headers should help.

print "Content-Type: text/html" # HTML is following
print # blank line, end of headers



william paul wrote:
Hello:
I am trying to configure IIS to work with Python scripts:
I've added in the Home Directory/Configuration the .py extention and the path to the python.exe as: c:\Python24\python.exe %S %S
The python script has 1 line:
print "This is a test for python scripts with IIS"
When I launch the file using IE I get the message:
*CGI Error*
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:
This is a test for python scripts with IIS
How can I remove the CGI error?
Thank you
William

------------------------------------------------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. <http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ%20>
.



Relevant Pages

  • Re: How to send email using the mail function on Windows XP?
    ... That would mean the mail got sent, but the receiving system didn't like what it saw (I don't use gmail). ... The easiest way would be to look at the headers for your email, and compare them to headers for a "good" email to see what the difference is. ... After reading some links I realized that it's not intuitive at all to configure the SMTP Server in IIS. ...
    (comp.lang.php)
  • Re: Multiple sites
    ... >> distinguish them by using host headers. ... When IIS ... browser. ... >> request. ...
    (microsoft.public.inetserver.iis.security)
  • Re: Routing
    ... and same port. ... KB Article 324287 explains how to set up Host Headers on the server. ... So this can be done with only one webserver. ... > different domains and I wonder whether it's possible to configure IIS to ...
    (microsoft.public.inetserver.iis)
  • Re: ASP.NET 2.0 maximum URL length?
    ... Have you posted the question to the IIS 7.0 forums? ... All the IIS 7.0 MVPs hang out there. ... I used Fiddler to check whether tweaking headers would ... HTTP 400 for ASP.NET requests and no "bad request" for HTML ...
    (microsoft.public.dotnet.framework.aspnet)
  • IIS Authentication bug?
    ... IIS environment we have the Jakarta redirector ISAPI filter connecting ... WWW-Authenticate: Digest headers in our code and these get passed back ... I don't have Integrated Windows authentication enabled. ...
    (microsoft.public.inetserver.iis.security)