Adding Keys and Values to Python Dictionary in Reverse Order
I have written a simple script that prints out and adds the name of a
table and it's associated column headings to a python list:
for table in arcpy.ListTables():
for field in arcpy.ListFields(table):
b.append(field.name + "," + fc)
print b
In each table there are a number of column headings. There are many
instances where one or more tables contain the same column headings. I
want to do a bit of a reverse python dictionary instead of a list, where
keys are the column headings and the values are the table names. My idea
is, to find the all the tables that each column heading lies within.
I've been playing around all afternoon and I think I am over thinking this
so I came here for some help. If anyone can suggest how I can accomplish
this, i would appreciate it.
Thanks, Mike
No comments:
Post a Comment