我用网页.py在
安装网页.py cd网络版 编辑python web服务。在
#!/usr/bin/env python
urls = ('/title_matching2','title_matching2')
app = web.application(urls,globals())
class title_matching2:
def __init__(self):
self.hello = "hello world"
def GET(self):
getInput = web.input(name="World")
processing the data, return the hash table, I wanted
return gg
if __name__ == "__main__":
app.run()
然后我运行这个web服务/一些.py,然后拨打:
^{pr2}$它返回一个哈希表这是我想要的
但是如果我使用多个参数运行web服务, 代码如下:
usr/bin/env python
urls = ('/title_matching4','title_matching4')
app = web.application(urls,globals())
class title_matching4:
def __init__(self):
self.hello = "hello world"
def GET(self):
getInput = web.input(title="World",prod="type")
title1=str(getInput.title)
prod1=str(getInput.prod)
processing the data, return the hash table I wanted.
return qq
if __name__ == "__main__":
app.run()
然后运行
./rest9.py
然后我用链接打开了一个链接
http://localhost:8080/title_matching4?title=diehard&prod=feature
没有返回哈希表,但我希望返回哈希表
屏幕上会出现如下内容:
[1] 1190年
我想知道为什么?
为什么我不能打开一个链接并得到一个哈希表?在
谢谢你!在
你看到的不是你的网页.py代码(正确无误)。它是从shell中响应“links”命令的。在
shell将看到未转义的与号(&;),并将您的
links
命令放在进程id为1190
的后台[1]
中执行。在用引号将URL括起来,例如:
相关问题 更多 >
编程相关推荐