我有这段代码,但我无法运行它,因为我收到了这个错误:“TypeError:'classobj' object is not subscriptable”,这是我的代码:
import cgi
import customerlib
form=cgi.FieldStorage
history = customerlib.find(form["f_name"].value,form["l_name"].value)
print "Content-type: text/html"
print
print """<html>
<head>
<title>Purchase history</title>
</head>
<body>
<h1>Purchase History</h1>"""
print "<p>you have a purchase history of:"
for i in history: "</p>"
print""" <body>
</html>"""
我在这个文件旁边有 customerlib 文件。知道如何解决吗?