在windows下安装webpy

来源:互联网 发布:机锋市场 淘宝 编辑:程序博客网 时间:2024/05/18 03:52

[prerequisite]

1. install python

http://www.python.org/getit/releases/2.7.3/
2. download webpy
http://webpy.org/install


[steps]
1.解压webpy压缩包
2.type "win+r" -> type "cmd" ->在webpy安装目录下 type "python setup.py install"

3.create demo app code.py:

import weburls = (    '/', 'index')class index:    def GET(self):        return "Hello, world!"if __name__ == "__main__":    app = web.application(urls, globals())    app.run()



4.in windows command line, type "python code.py"
also you can define another port "python code.py ANOTHERPORT"
5.检查端口是否正提供服务
netstat -aon|findstr "PORT"
the PORT is "8080" by default if you type "python code.py" in former step
或者可通过浏览器访问
http://localhost:PORT


[reference]
webpy+python2.7+linux环境搭建 http://blog.csdn.net/five3/article/details/8005495
nginx[+spawn-fcgi]+flup+webpy服务搭建 http://blog.csdn.net/five3/article/details/7732832
Webpy Install Guide http://webpy.org/install
web.py 0.3 新手指南 http://webpy.org/docs/0.3/tutorial.zh-cn

原创粉丝点击