python 中cgi 求指点
python如何将登录之后的结果返回给客户端?比如:自己写了个html登录界面,登录之后把结果反回给客户端,这个界面是由python写的代码如下:
def DisplayTables():
print "Content-type:text/html"
print """<HTML>
<HEAD>
<TITLE>Choose Table</TITLE><HEAD><BODY>"""
form = cgi.FieldStorage()
print "You selected table:"
selections = form.getlist('data')
printable = [cgi.escape(x) for x in selections]
print ", ".join(printable)
print """<FORM METHOD = "GET" ACTION = "%s">
Select some things:<p>""" % os.environ['LOGNAME']
for item in gRows:
print '<INPUT TYPE = "checkbox" NAME = "data" VALUE = "%s">' % cgi.escape(item)
print '%s<BR>' % cgi.escape(item)
print """<INPUT TYPE = "submit" NAME = "submit" VALUE = "Submit">
</FROM>
</BODY></HTML>"""
[ 本帖最后由 fyy376778785 于 2012-7-24 19:28 编辑 ]