1

I am using the following code to delete a field from a shapefile but I am getting an error!

def main():
    # Import arcpy module
   import arcpy

# Local variables:
   point_shp = "G:\\Temp\\All_Provinces.shp"

# Process: Add Field
   #arcpy.AddField_management(point_shp, "NEWFIELD", "TEXT", "", "", "25", "", "NON_NULLABLE", "NON_REQUIRED", "")

   arcpy.DeleteField_management(point_shp,NEWFIELD)
if __name__ == '__main__':
    main()

can you please let me know what I am doing wrong?

  • 2
    The error is all important. Can you edit your question and post it? – user681 Dec 22 '13 at 2:59
3

ok error was on

arcpy.DeleteField_management(point_shp,NEWFIELD)

must be

arcpy.DeleteField_management(point_shp,"NEWFIELD")
| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.