web.py急速体验

  1. 安装
pip intall web.py
  1. 新建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()
  1. 运行web1.py
python web1.py
  1. 访问浏览器输入ip:8080