Python web开发环境搭建

web包下载路径:python

http://webpy.org/static/web.py-0.37.tar.gz

下载以后解压:将目录文件夹下的web文件夹拷贝到你的python项目路径下web

以后新建一个hello_web.py文件:app

'''
Created on 2014-2-27
@author: Administrator
'''
import web
urls = ("/.*", "hello")
app = web.application(urls, globals())
class hello:
    def GET(self):
        return 'Hello, world!'
if __name__ == "__main__":
    app.run()

以后运行,在网页端输入:http://localhost:8080/hellourl

运行结果:code

在网页中显示:get

Hello, world!
相关文章
相关标签/搜索