是不是要FieldStorage?
1 import cgi 2 3 import athletemodel 4 import yate 5 6 atheletes = athletemodel.get_from_store() 7 8 form_data = cgi.FieldStorage() 9 athlete_name = form_data['which_athlete'].value 10 11 print(yate.start_response()) 12 print(yate.include_header("Coach Kelly's Timing data")) 13 print(yate.header("Athlete:"+ athlete_name+"'s DOB:"+athlete[athlete_name].dob + ".")) 14 print(yate.para("The top times for this athlete are:")) 15 print(yate.u_list(athlete[athlete_name].top3)) 16 print(yate.include_footer({"Home":"/index.html","select another athlete":"generate_list.py"}))
我直接跑这两句,没问题
import cgi
form_data = cgi.FieldStorage()
你是不是自己创建了一个文件,叫cgi.py