【发布时间】:2016-07-30 04:10:01
【问题描述】:
变得非常困惑。四处搜索,但找不到任何有用的帮助。我收到错误
Traceback(最近一次调用最后一次): 文件“/Users/Andrew/Desktop/password.py”,第 2 行,在 形式 = cgi.Fieldstorage() AttributeError: 'module' 对象没有属性 'Fieldstorage'
import cgi
form = cgi.Fieldstorage()
print """Content-type: text/html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html><head>
<title>Lab 10</title>
</head><body>
"""
password = form.getvalue("password")
if password=="12345":
print "<p>Password correct.</p>"
else:
print "<p>Sorry, try again.</p>"
print "</body>"
print "</html>"
【问题讨论】:
标签: python