1、照着官网安装web.py
http://webpy.org/tutorial3.zh-cn#starting
python -m pip install web.py
2、敲下下面代码
#encoding:utf-8
import web
urls=('/(.*)','hello')
app=web.application(urls,globals())
class hello:
'''
hello页面 处理类
'''
def GET(self,name):
'''
Get请求方式执行内容
:param name: 运行改脚本在浏览器中输入http://localhost:8080/python name=python,默认是world
:return:
'''
if not name:
name="world"
return "Hello "+name
if __name__=="__main__":
app.run()
3.运行结果