如何在Python(CGI)中修改查询字符串
我正在用Python尝试CGI编程,想知道怎么修改查询字符串。
比如,如果我有一段HTML代码:
<form action="/cgi-bin/text.py" method="get">
<textarea name="stuff"></textarea>
<button type="submit">Submit</button>
</form>
那么查询字符串可能是这样的:
http://www.foobar.com/cgi-bin/test.py?stuff=Some+text+here
如果我的Python脚本返回HTML,我该怎么把查询字符串改成类似这样的:
http://www.foobar.com/cgi-bin/test.py?stuff=Some+text+here#anchor
这样浏览器就能跳到脚本返回的HTML文档中的合适位置了?