## ## lookup_table - convert first two columns of an SQL query to a lookup table ## def lookup_table(curs, query): lookup = ExtendedDict() curs.execute(query) for row in curs.fetchall(): key = row[0] value = row[1] lookup[key] = value return lookup