AnsweredAssumed Answered

Python: DeleteField Management_for loop

Question asked by LarryAdgate on Feb 2, 2015
Latest reply on Feb 3, 2015 by LarryAdgate

If someone could help me with this, I would forever be greatful. My preference is not to repeat DeleteField_management three times for the three diffrent feature classes, but to use a for loop and loop through all the feature classes except my creation will not work. Please help

 

Thanks, Larry 

 

 

# Import arcpy module
import arcpy

# Local variables:
Arden = "C:\\Projects\\TestProject.gdb\\Project\\Arden"
Baypoint = "C:\\Projects\\TestProject.gdb\\Project\\Baypoint"
Clearlake = "C:\\Projects\\TestProject.gdb\\Project\\Clearlake"

 

mylist = Arden, Baypoint, Clearlake

 

for delete in mylist:
     arcpy.DeleteField_management(mylist, "Pump;Well;Tank")

     print "Finished the Delete Function"   

Outcomes