Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我来自 Flask,处理带有斜杠字符的 URL 非常简洁: http: //flask.pocoo.org/snippets/76/
我现在正在使用 web.py,我也想做同样的事情。我事先不知道网址会有多少个斜线。任何想法?
可能你可以只使用一个普通的:
urls = ( "/product/(.*)", product_handler )
然后产品处理程序采用一个变量:
class product_handler: def GET(self, url_string): url_pieces = url_string.split('/') # ...
像这样的东西?