The ListEnvironments function returns a Python list of geoprocessing environment names.
The wild card limits the results returned. If no wild card is specified, all values are returned.
# A wild_card of "*workspace" will return a list including the # workspace and scratchWorkspace environment names arcpy.ListEnvironments("*workspace")
The Python List returned from the function containing the geoprocessing environment variable names, optionally limited by a wild card filter.
Lists the environment variable name and current value.
import arcpy from arcpy import env environments = arcpy.ListEnvironments() for environment in environments: # As the environment is passed as a variable, use Python's getattr function # to evaluate the environment's value # envSetting = getattr(env, environment) # Format and print each environment and its current setting # print "%-28s: %s" % (environment, envSetting)