1 精确完全匹配
/index
2 模糊匹配
/post/\d+
3 任意带组,
/post/(\d+)
记忆如下:”
/
//\d+【一个数字/八d】
/(.*)【任意匹配】
import web
urls=(
'/index','index',
'/name/\d+','name',
'/(.*)','hello',
)
app = web.application(urls,globals())
class index:
def GET(self):
return 'index 完全匹配方法'
class name:
def GET(self):
return '模糊匹配'
def POST(self):
return '模糊匹配'
class hello:
def GET(self,number):
return '任意匹配'+number
if _number_=="_main_"
app.run()