main 安装 self name globals bject pytho log
1、安装 web.py 模块 easy_install web.py
2、实现代码
- import web
- urls = (' / hello', 'hello', )
- class hello(object) : def GET(self) : return'hello world'
- if __name__ == "__main__": app = web.application(urls, globals()) app.run()
Python 简单 Web 框架 web.py 实例 hello world
来源: http://www.bubuko.com/infodetail-2218365.html