使用URL(python)将参数传递给CGI程序

DCr*_*ovC 3 html python cgi

正如标题所示,我正在尝试将参数传递到我的cgi脚本中,以便在您输入时(例如):www.helloworld.com/cgi-bin/world.py?post=101,脚本将显示岗位

我尝试过以下方法:

link = '<a href="world.py?post=%s">test</a>' % postNumber

link = cgi.FieldStorage()
id = link.getvalue('post')
print id
Run Code Online (Sandbox Code Playgroud)

但是id的价值不算什么.这就像是没有正确阅读链接或其他东西.

请帮忙!

Ale*_*lds 6

怎么样:

id = link["post"].value
print id
Run Code Online (Sandbox Code Playgroud)