I'm migrating from Perl to Python and unable to identify the equivalent of key of key concept. The following codes run well,
import csv attr = {} with open('test.txt','rb') as tsvin: tsvin = csv.reader(tsvin, delimiter='\t') for row in tsvin: ID = row[1] until: attr[ID]['adm3'] = row[2] I then try: attr[ID].adm3 = row[2] still doesn't work. Some posts suggest using module dict but some do not. I'm a bit confused now. Any suggestions? -- https://mail.python.org/mailman/listinfo/python-list