python web.py
641 ワード
Web.pyを使用すると、Webサービスをすばやく起動できます.
# -*- coding: utf-8 -*-
import web
urls = (
'/(.*)', 'hello')
class hello:
def GET(self, name):
print name
print web.ctx.env
return "hello"
def POST(self,name):
print name
print web.ctx.env.get("HTTP_USER_AGENT")
print web.ctx.env
return "hello"
app = web.application(urls, globals())
application = app.wsgifunc()
if __name__ == "__main__":
app.run()