I want to figure out how to be able to change values in fields for use in further projects. Right now , I would like to be able to add '-WA' to the existing field value 53. (ie 53-WA). This is a test project as I am trying to teach myself python. The code I got so far runs but the values do not change.
import arcpy, osarcpy.env.workspace = r'C:\Users\david.fleck\Python.mdb'fc= 'Parking_Lots_Collected_2015'field = ['STATEFP']cursor = arcpy.UpdateCursor(fc,field)with arcpy.da.UpdateCursor(fc,field)as cursor: for row in cursor: if row== 53: row.setValue(row.getValue(field) + '-WA') cursor.updateRow(row)print "Finished"I have also tried row ==''53 + '-CA' instead of row.setvalue but still no change.
أكثر...
import arcpy, osarcpy.env.workspace = r'C:\Users\david.fleck\Python.mdb'fc= 'Parking_Lots_Collected_2015'field = ['STATEFP']cursor = arcpy.UpdateCursor(fc,field)with arcpy.da.UpdateCursor(fc,field)as cursor: for row in cursor: if row== 53: row.setValue(row.getValue(field) + '-WA') cursor.updateRow(row)print "Finished"I have also tried row ==''53 + '-CA' instead of row.setvalue but still no change.
أكثر...