
我正在嘗試讓 Python 與 IIS 7.5 一起工作。
我為 Python 新增了一個腳本處理程序:
Python本身似乎不是問題。我在命令行上運行腳本沒有問題。我用來測試 Python 功能的腳本如下:
print
print 'HTTP/1.0 Status: 200 OK'
print 'Content-type: text/html'
print
print '<HTML><HEAD><TITLE>Python Sample CGI</TITLE></HEAD>'
print '<BODY>'
print '<H1>This is a header</H1>'
print '<p>' #this is a comment
print 'See this is just like most other HTML'
print '<br>'
print '</BODY>'
問題是 IIS 似乎text/plain
在執行 python 腳本之前將 HTTP 內容類型標頭設定為,因為當我在瀏覽器中瀏覽到 python 腳本時,我得到以下輸出:
我做錯了什麼,我該如何解決這個問題?