好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

Windows Server 2008 (IIS7)中配置使用 Python 3.0 - Windo

1.首先当然是 下载 Python 了,推荐安装 ActivePython 这里我用的是3.0版本      安装后才了解Google App Engree目前服务器运行的是2.5版本 -_-||| 这里下载: Windows x86 版本

Windows x86 Linux x86 Linux x86_64 Mac OS X (Universal) Solaris 8 SPARC Solaris 8 SPARC (64-bit) Solaris 10 x86 AIX PowerPC HP-UX PA-RISC 2.安装 ActivePython 就不用说了。一路Next >>

3.IIS7 的控制管理器   ,在站点的ISAPI and CGI 限制 中配置 C:Python30Python.exe %s %s

4.在站点的 处理程序映射 中添加"*.py"到 C:Python30Python.exe %s %s 的映射

5.添加IIS 中的默认文档

6.打开你在IIS中添加网站的目录,找到 web.config

修改为如下内容: <?xml version="1.0" encoding="UTF-8"?> <configuration>     <system.webServer>         <handlers>             <add name="ActiveState3.0" path="*.py" verb="*" modules="CgiModule" scriptProcessor="C:Python30Python.exe %s %s" resourceType="Unspecified" />         </handlers>     </system.webServer> </configuration> 7. 测试Python 是否可以正常工作了 1)重新启动 IIS 2) 编写一个测试 index.py 文档 ,放在网站目录下,内容如下: (为 Python3.0+ 代码,不向下兼容) print (Status: 200 OK) print (Content-Type: text/html) print () print (<html><head><title>Hello Xeye</title></head>) print (<body>) print (<h1>Hello, Xeye!</h1>) print (</body>) print (</html>)

3)打开 浏览器 。访问添加的网站,如果能看到如下的画面,恭喜,你的IIS7已经可以支持 Python 了

查看更多关于Windows Server 2008 (IIS7)中配置使用 Python 3.0 - Windo的详细内容...

  阅读:65次