ListDatasets (arcpy)
Resumen
Lists all of the datasets in a workspace. Search conditions can be specified for the dataset name and dataset type to limit the Python List that is returned.
Debate
The workspace environment must be set first before using several of the List functions, including ListDatasets, ListFeatureClasses, ListFiles, ListRasters, ListTables, and ListWorkspaces.
Sintaxis
Parámetro | Explicación | Tipo de datos |
wild_card |
El comodín limita los resultados que se obtienen. Si no se especifica ningún comodín, se obtienen todos los valores. | String |
feature_type |
The feature type to limit the results returned by the wildcard argument. Valid dataset types are:
(El valor predeterminado es All) | String |
Tipo de datos | Explicación |
String |
A list containing dataset names returned from the function, limited by the wildcard and feature type arguments. |
Ejemplo de código
List Feature Dataset names that start with C.
import arcpy
arcpy.env.workspace = "C:/Data"
# Print to the Interactive window all the feature datasets in the workspace
# that start with the letter C.
#
datasetList = arcpy.ListDatasets("C*", "Feature")
for dataset in datasetList:
print dataset