获得数据源和路径desc.catalogPath
workspace:C:\Users\dell\Documents\ArcGIS\Default.gdb\ddf
inPath:c:\users\dell\documents\arcgis\default.gdb\ddf\sz
file:sz
extension:
baseName:sz
Name:sz
dataType:FeatureLayer
inFeature=arcpy.GetParameterAsText(0) desc=arcpy.Describe(inFeature)
inPath=desc.catalogPath.lower()
workspace=desc.path arcpy.AddMessage("workspace:"+workspace) arcpy.AddMessage("inPath:"+inPath) arcpy.AddMessage("file:"+desc.file) arcpy.AddMessage("extension:"+desc.extension) arcpy.AddMessage("baseName:"+desc.baseName) arcpy.AddMessage("Name:"+desc.name) arcpy.AddMessage("dataType:"+desc.dataType)