def toDict(curs):
    """Convert a DBI result to a list of dictionaries."""
    cols = [column[0] for column in curs.description]
    return [dict(zip(cols, row)) for row in curs.fetchall()]
Convert a DBI result to a list of dictionaries.
recipes/Python/528939_Converting_DBI_results_list/recipe-528939.py