Why is recordset result being returned in this way for Python database query?

Posted by Scott on Stack Overflow See other posts from Stack Overflow or by Scott
Published on 2010-04-27T17:21:25Z Indexed on 2010/04/27 17:23 UTC
Read the original article Hit count: 214

Filed under:
|
|
|

I have searched high and low for an answer to why query results returned in this format and how to convert to a list.

data = cursor.fetchall()

When I print data, it results in: (('car',), ('boat',), ('plane',), ('truck',))

I want to have the results in a list as ["car", "boat", "plane", "truck"]

© Stack Overflow or respective owner

Related posts about python

Related posts about mysql