import arcpy
def MDBToSHP(inMdb, outPath):
arcpy.env.workspace = inMdb
outLocation = outPath
fcs = arcpy.ListFeatureClasses()
fcCount = len(fcs)
for fc in fcs:
# Copy the features from the workspace to a folder
arcpy.FeatureClassToShapefile_conversion(fc, outLocation)
print fc
print fcCount
inMDB = r"D:\07\07.mdb"
outLocation = r"D:\07"
MDBToSHP(inMDB, outLocation)
上一篇博客中有相似的非函数式的写法