I have this code.
cursor.execute("select id, name from client")
clientids= cursor.fetchall()
clientidList = []
for clientid in clientids:
#I can do that
clientidList.append(clientid [0])
#but I can't do that.
clientidList.append(clientid ['id'])
Whit the second try I get an error TypeError: 'tuple' object is not callable
any idea why this is not possible? is there is any other way to accomplish that, because it's more comprehensive when I put the attribute name than the index, exactly in a query that has more than 20 columns output.
I tried this but it didn't work for me
Thanks!