我尝试有两个不同的提交按钮。如果按下一个提交按钮,它将转到一个cgi脚本,如果按下另一个按钮,它将转到另一个cgi脚本。下面是我的代码,但它没有按我所希望的那样工作。无论按哪个脚本,它们都只转到同一个脚本。在#!/usr/bin/env python
import cgi
import cgitb
cgitb.enable()
form = cgi.FieldStorage()
keyword = form.getvalue('keyword')
keyset = set(x.strip() for x in open('keywords.txt', 'r'))
print 'Content-type: text/html\r\n\r'
print ''
print "Set = ", keyset
print '
If your keyword is in the set, use this submission button to retrieve recent tweets
'print '
'print 'Keyword:
'
print ''
print ''
print 'Content-type: text/html\r\n\r'
print ''
print '
If your desired keyword is not in the set, use this submission button to add it
'print '
'print 'Keyword:
'
print ''
print ''