1. 程式人生 > >arcgis for python 使用os.walk 和da.walk讀取gdb(mdb)

arcgis for python 使用os.walk 和da.walk讀取gdb(mdb)

import arcpy.da as da

... import os

... print("os walk")

... for dirpath, dirnames, filenames in os.walk("C:\Users\Administrator\Documents\ArcGIS\Default.gdb"):

...     for filename in filenames:

...         print(filename)

...

... print("arcpy da walk")

...

... for dirpath, dirnames, filenames in da.Walk("C:\Users\Administrator\Documents\ArcGIS\Default.gdb",datatype="FeatureClass"):

...     for filename in filenames:

...         print(os.path.join(dirpath, filename))