I have a geodatabase and I would like to be able to delete layers in there easily using ArcPy. Also select which type of files.
Example: delete all file tables from the gdb or all layers.
Code:
env.workspace = r"path.gdb"
for i in arcpy.ListFeatureClasses():
#how to delete?
Best Answer
There are many options to modify each of list so head to help links to get more info.
Help links:
feature clases - http://pro.arcgis.com/en/pro-app/arcpy/functions/listfeatureclasses.htm
tables - http://pro.arcgis.com/en/pro-app/arcpy/functions/listtables.htm
data sets - http://pro.arcgis.com/en/pro-app/arcpy/functions/listdatasets.htm
delete - http://pro.arcgis.com/en/pro-app/tool-reference/data-management/delete.htm