您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

一个超级简单的python web程序

2024/2/28 12:32:40发布16次查看
在mac/linux环境下,执行vi hello.py命令,并输入以下代码
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
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product