原始脚本
import arcpy, os
from collections import defaultdict
# Set work environemnt
arcpy.env.workspace = r'E:\test'
# Set output GDB, search keyword
output_gdb = r'E:\ArcGIS Pro\test.gdb'
search = 'TEST'
fc = []
# use walk return data names in directory
walk = arcpy.da.Walk(datatype = 'FeatureClass', type = 'polygon')
# append selected feature into the fc list
for dirpath