import webimport sys urls = (/service/hello,hello)app = web.application(urls,globals()) class hello: def get(self): return 'hello,world!';if __name__==__main__: app.run()
执行python hello.py 8080出现
http://0.0.0.0:8080/
然后访问http://localhost:8080/service/match地址,返回结果为
hello,world!
终端的结果为:
127.0.0.1:49400 - - [15/aug/2014 17:57:26] http/1.1 get /service/match - 200 o
