TypeError 'classobj' object has no attribute '__getitem__' in python -
I am starting in Python and I do not know how to fix it. help please.
error:
traceback (last call final): file "C: \ user \ priskilla \ desktop \ CMPT Assn # 3 \ page.py", line 17, & lt; Module & gt; Print "& lt; p & gt; Customer Name:", ["custName"] form. Value, "& lt; / p & gt;" TypeError: 'classobj' has no attribute in the object '__getitem__'
Python Script:
import cgi form = cgi.FieldStorage # print HTTP / HTML Header Content Print "" "Content-Type: Text / HTML & lt ;! DOCTYPE HTML Public" - // W3C // DTD XHTML 1.0 Strongly //n "" http://www.w3.org/TR/xhtml1/ DTD / xhtml1 -strict.dtd "> gt; Top & gt; & lt; title & gt; Order Form & lt; / title & gt; & lt; / head & gt; ; & Lt; body & gt; "H1> Kanthouro Japanese Bar & Restaurant" "Print" & lt; h2 & gt; Customer Receipt & lt using "Print HTML Body Form Data Print" ; / H2 & gt; Print "& lt; p & gt; Customer Name:", ["custName"] form. Value, "& lt; / p & gt;" Print "& lt; p & gt; Customer email address:", ["custEmail"] form. Value, "& lt; / p & gt;" Print "& lt; h2 & gt; Customer Address: & lt; / h2 & gt;" Print "& lt; p & gt; Street:", [[custAdd]] form value, "& lt; / p & gt;" Print "& lt; p & gt; City:", ["custcity"] form. Value, "& lt; / p & gt;" Value as "Print" & lt; p & gt; Provinces: ", [" custProv "]," & lt; / p & gt; " Print "& lt; p & gt; Pin Code:", form ["custPostal"] value, "& lt; / p & gt;". Print "& lt; h2 & gt; Payment Information: & lt; / h2 & gt; Print "& lt; p & gt; Card type:", form ["type1"] value, " Print "& lt; p & gt; Card number: xxxx-xxxx-xxxx-", form ["four4"] value, "& lt; / p & gt;" Print "& lt; p & gt; End date:", [[expDate "] form []," & lt; / P & gt; Assigns
form = cgi.fieldStorage
Go to field storage
yourself form
Instead of providing an example of FieldStorage
:
form = cgi.FieldStorage ()
Comments
Post a Comment