unsubscriptable object error

MCollins at seminolecountyfl.gov MCollins at seminolecountyfl.gov
Thu Aug 18 07:49:35 EDT 2005


getting an unsubscriptable object error on an if else statement


db = MSSQL.connect(server,login,pwd,database)
c = db.cursor()
c.execute(mySQL)
rows = c.fetchone()
 
 
#determine recipient
if str(rows[3]) == str(rows[4]):
        recipient = str(rows[0]) + " " + str(rows[1])
 
else:
        recipient = "test"



the above code works fine if rows[3] == rows[4].  it's when it doesn't 
equal that it gives the error::

TypeError: unsubscriptable object 
      args = ('unsubscriptable object',) 





Matthew Collins
Senior Programmer Analyst, Information Technologies
Seminole County Government
1101 E First St
Sanford, FL 32771

Office 407-665-1072
Fax 407-665-1025
http://www.seminolecountyfl.gov


--****Florida has a very broad Public Records Law. Virtually all written 
communications to or from State and Local Officials and employees are 
public records available to the public and media upon request.  Seminole 
County policy does not differentiate between personal and business emails. 
 E-mail sent on the County system will be considered public and will only 
be withheld from disclosure if deemed confidential pursuant to State 
Law.****
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20050818/efd6f964/attachment.html>


More information about the Python-list mailing list