[Tutor] (no subject)

Devansh Dhutia devanshd@yahoo.com
Fri, 1 Dec 2000 13:16:38 -0600


This is a multi-part message in MIME format.

------=_NextPart_000_0034_01C05B98.F089E760
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

hi everyone,
i have a small prob. i hvae a simulation to run n the following 3 lines =
are where i m reading from an input file where i have the customer =
database...
i have a customer class n its something like this

class customer:
    def __init__(self,card_num,pin,name,chk_bal,sav_bal,pic):
        self.card_num=3Dcard_num
        self.pin=3Dpin
        self.name=3Dname
        self.chk_bal=3Dchk_bal
        self.sav_bal=3Dsav_bal
        self.pic=3Dpic
an example line in my input file is=20
customer(123456,1234,'Devansh Dhutia',111,222,list[11])

this is the section where i read the lines....

user=3Dcustdb.readline()
user=3Deval(user)
cust_list.append(user)

and this is the error i get on the 2nd line..


Traceback (innermost last):
  File "<string>", line 1, in ?
  File "A:\ATM\ATMsimB.py", line 297, in ?
    main()
  File "A:\ATM\ATMsimB.py", line 296, in main
    simulation()
  File "A:\ATM\ATMsimB.py", line 177, in simulation
    customervalidation(cardnumforverify,pinforverify)
  File "A:\ATM\ATMsimB.py", line 191, in customervalidation
    actualcard=3Deval(actualcard).getcard()
  File "<string>", line 0, in ?
TypeError: unsubscriptable object

pls advise..
thanx

Devansh Dhutia


------=_NextPart_000_0034_01C05B98.F089E760
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>hi everyone,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>i have a small prob. i hvae a =
simulation to run n=20
the following 3 lines are where i m reading from an input file where i =
have the=20
customer database...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>i have a customer class n its something =
like=20
this</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>class customer:<BR>&nbsp;&nbsp;&nbsp; =
def=20
__init__(self,card_num,pin,name,chk_bal,sav_bal,pic):<BR>&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;=20
self.card_num=3Dcard_num<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
self.pin=3Dpin<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
self.name=3Dname<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
self.chk_bal=3Dchk_bal<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
self.sav_bal=3Dsav_bal<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
self.pic=3Dpic</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>an example line in my input file is =
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>customer(123456,1234,'Devansh=20
Dhutia',111,222,list[11])</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>this is the section where i read the=20
lines....</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial=20
size=3D2>user=3Dcustdb.readline()<BR>user=3Deval(user)<BR>cust_list.appen=
d(user)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>and this is the error i get on the 2nd=20
line..</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Traceback (innermost last):<BR>&nbsp; =
File=20
"&lt;string&gt;", line 1, in ?<BR>&nbsp; File "A:\ATM\ATMsimB.py", line =
297, in=20
?<BR>&nbsp;&nbsp;&nbsp; main()<BR>&nbsp; File "A:\ATM\ATMsimB.py", line =
296, in=20
main<BR>&nbsp;&nbsp;&nbsp; simulation()<BR>&nbsp; File =
"A:\ATM\ATMsimB.py", line=20
177, in simulation<BR>&nbsp;&nbsp;&nbsp;=20
customervalidation(cardnumforverify,pinforverify)<BR>&nbsp; File=20
"A:\ATM\ATMsimB.py", line 191, in =
customervalidation<BR>&nbsp;&nbsp;&nbsp;=20
actualcard=3Deval(actualcard).getcard()<BR>&nbsp; File "&lt;string&gt;", =
line 0,=20
in ?<BR>TypeError: unsubscriptable object</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>pls advise..</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>thanx</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Devansh =
Dhutia<BR></DIV></FONT></BODY></HTML>

------=_NextPart_000_0034_01C05B98.F089E760--


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com