ListEnvironments (arcpy)

摘要

ListEnvironments 函数可返回地理处理环境名称列表。

语法

ListEnvironments ({wild_card})
参数说明数据类型
wild_card

wild_card 可限制返回的结果。如果未指定任何 wild_card,则会返回所有值。

import arcpy

# A wild_card of "*workspace" will return a list including the 
#   workspace and scratchWorkspace environment names
arcpy.ListEnvironments("*workspace")
String
返回值
数据类型说明
String

该函数返回的列表包含可受通配符过滤器限制的地理处理环境变量名称。

代码实例

ListEnvironments 示例

列出环境变量名称和当前值。

import arcpy

environments = arcpy.ListEnvironments()

# Sort the environment names
environments.sort()

for environment in environments:
    # Format and print each environment and its current setting.
    # (The environments are accessed by key from arcpy.env.)
    print("{0:<30}: {1}".format(environment, arcpy.env[environment]))

相关主题

5/10/2014