I have a list of feature classes (fcList) that I would like to do the following.
- add a field (fire_dis)
- update row from a single value from a dictionary(fcnaDict)
- more specifically I am trying to run this through a loop so that the first item in the fcList will get the first dictionary value "Livingston Fire" and so on until every fc has the reciprocal dictionary value.
Here is my code. FYI I am quite new at python.
## This is my dictionary
fcnaDict = { "a2":"Livingston Fire", "b2":"Gardiner Fire Department & Gateway Hose Co",
"c2":"Cooke City Silver Gate VFD", "d2":"Clyde Park City", "e2":"Clyde Park RFD",
"f2":"Wilsall RFD", "g2":"Park County RFD1", "h2":"Paradise Valley FSA",
"i2":"County Protection", "j2":"Null Parcels", "k2":"Other Exparcels",
"l2":"FS parcels", "m2":"DNRC parcels"}
## This is my list of objects for feature classes
fcList = [ a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2]
## This is my loop with the above mentioned items
for fc in fcList:
arcpy.AddField_management( fc,"fire_dis", "TEXT", 100)
cursor = arcpy.da.UpdateCursor(fc,"fire_dis",)
for row in cursor:
row[0] = fcnaDict.values(
cursor.updateRow(row)
The error I am getting now is that updateRow does not support lists.
Aucun commentaire:
Enregistrer un commentaire