Skip to content

Instantly share code, notes, and snippets.

@morehavoc
Created July 25, 2014 20:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save morehavoc/01b423b581c1bd7368be to your computer and use it in GitHub Desktop.
Save morehavoc/01b423b581c1bd7368be to your computer and use it in GitHub Desktop.
Quick Method to list all of the feature classes, even in folders, in any geodatabase and in feature datasets
import arcpy
from os.path import abspath, join
directory = r"C:\Users\cmoravec\Documents\ArcGIS"
def walk_directory(directory):
output_list = list()
for base_dir, child_dirs, filenames in arcpy.da.Walk(directory, datatype='FeatureClass'):
for filename in filenames:
data = join(abspath(base_dir), filename)
output_list.append(data)
return output_list
output_data = walk_directory(directory)
print output_data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment