im beginner with python.I want to convert sql results to a list.Here\'s my code:
cursor = connnect_db() query = \"SELECT * FROM `tbl`\" cursor.execute(query)
if you are using stored procedure you can convert results to list like this.
cursor = connection.cursor() parameters = [] cursor.callproc('spProcedureName', parameters) resultList =[r.fetchall() for r in cursor.stored_results()][0] cursor.close()