class dbhelper: def __init__(self,db): self.db=db def resultToDict(self, table, resultrow): c=self.db.cursor() result=c.execute("DESCRIBE %s"%table) dict={} for i in resultrow: row=c.fetchone() fielddescription=row[0] dict[fielddescription]=i c.close() return dict