我试图访问python脚本中的查询字符串:在bash中,我会使用${QUERY_STRING}
环境变量访问它。如何访问Python CGI脚本中的URL查询字符串?
我碰到过这样的事情:https://stackoverflow.com/a/2764822/32836,但这个剧本,由Apache2的运行:
#!/usr/bin/python
print self.request.query_string
打印什么,在命令行中,同样会产生这个错误:
$ ./testing.py
Traceback (most recent call last):
File "./testing.py", line 3, in <module>
print self.request.query_string
NameError: name 'self' is not defined
如何阅读query_string?
http://stackoverflow.com/questions/2709821/python-self-explained – cianius