- 安装
pip intall web.py
- 新建web1.py
import web urls = ( '/(.*)', 'hello' ) app = web.application(urls, globals()) class hello: def GET(self, name): if not name: name = 'World' return 'Hello, ' + name + '!' if __name__ == "__main__": app.run()
- 运行web1.py
python web1.py
- 访问浏览器输入ip:8080