hello! i read a lot in that forum, but i couldn't find a proper way to add all items to my dictionary... So maybe someone can help me! first a explanation:
rows = cur.fetchall()
columns=[desc[0] for desc in cur.description]
GID_Distances = {}
if len(rows) > 0:
for row in rows:
items = zip(columns, row)
GID_Distances = {}
for (name, value) in items:
GID_Distances[name]=value
rows is a list from a sql-statement. so in that list are several values with the same key... I just want to get something like a table something like this: {['id': 1, 'point':2], ['id':2, 'point':3]} but for the loop above is the result just the last item, because it overwrites all before. Any ideas????