Hello I want to create a dictionary (from SQL usernames) of the format: accounts = { ('psmit', '123456'): 'psmit', ('rmatt', 'mypass'): 'rmatt', }
So I have: accounts = {} UserCursor.execute(sqlstr) rows = UserCursor.fetchall() UserConn.commit() for row in rows: U = row['User'] P = row['Password'] InnerDict = {} InnerDict[U] = P accounts[InnerDict] = U But I get: TypeError: dict objects are unhashable Unfortunately, I just can't see what I'm doing wrong Thanks ___________________________________________________________ NEW Yahoo! Cars - sell your car and browse thousands of new and used cars online! http://uk.cars.yahoo.com/ _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor