ListEnvironments (arcpy)
Resumen
The ListEnvironments function returns a Python list of geoprocessing environment names.
Sintaxis
ListEnvironments ({wild_card})
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 |
Tipo de datos | Explicación |
String |
The Python List returned from the function containing the geoprocessing environment variable names, optionally limited by a wild card filter. |
Ejemplo de código
ListEnvironments example
Lists the environment variable name and current value.
import arcpy
import string
environments = arcpy.ListEnvironments()
# Sort the environment list, disregarding capitalization
#
environments.sort(key=string.lower)
for environment in environments:
# As the environment is passed as a variable, use Python's getattr
# to evaluate the environment's value
#
envSetting = getattr(arcpy.env, environment)
# Format and print each environment and its current setting
#
print "{0:<30}: {1}".format(environment, envSetting)
Temas relacionados
9/11/2013