I am trying to insert data from a text file into an SQL table. I'm getting this error:
"
csv_data = csv.reader(file('TxtFile1.txt', 'r'))
TypeError: 'list' object is not callable
"
import MySQLdb, csv, sys
conn = MySQLdb.connect (host = "localhost",user =
"a", passwd = "b",db = "c")
c = conn.cursor()
csv_data = csv.reader(file('TxtFile1.txt', 'r'))
for row in csv_data: print row
row = csv_data.next()
c.execute("INSERT INTO a (Category, Value) VALUES (%s, %s)", row)
#c.commit()
#c.close()
I just want to know why this error is occurring and how it can be remedied. Any help would be great, thanks.