Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import web
- import httplib
- urls = ("/(.+?)/?", "http_err")
- app = web.application(urls, globals())
- class http_err:
- def GET(self, err_code):
- err_code = int(err_code.split("/")[0])
- response = "%d %s" % (err_code, httplib.responses[err_code])
- raise web.HTTPError(response)
- if __name__ == "__main__":
- app.run()
Add Comment
Please, Sign In to add comment