I have a dictionary whose keys are map segment names, and whose value is a list of three field values.
Using an arcpy.da.SearchCursor on the map segments FeatureLayer, I have extracted the extent object and the names for the segments.
Using the similar map segment names, I want to append the extent values to the dictionary keys (so that I can reference them later). How would I do this, you can't index an Extent object.
for instance:
{'m32': [7, 10, 13], 'm33': [7, 10, 13]}...
turns into something like:
{'m32': [7, 10, 13,XMin,Ymin,XMax,YMax], 'm33': [7, 10, 13,XMin,Ymin,XMax,YMax]}...
so that when I index it, I can index the key, the original values, and index the extent values.
Best Answer
For adding a new items to a python list object use append. The basic syntax is list.append(addedItem). With a dictionary containing a list it is dictionary(key).append(addedItem).
Here is a script skeleton that creates a dictionary which has a list of lists as its value: