def_select2dic(self, sql, values=[]): cur = self._execute(sql, values) fields = [f[0] for f in cur.description] for row in cur: yield dict(zip(fields, [tostr(x) for x in row]))
print(db._select2dic("select * from test.tt")) >> <generator object _select2dic at 0x104f44b40>