ListVersions

摘要

Lists the versions the connected user has permission to use. A Python List is returned by the function.

讨论

You can specify the path to an ArcSDE connection file as an argument to the function or you can set the workspace environment to the ArcSDE Connection file and call the ListVersions function without any arguments. Only those versions the connected user has permissions to use will be included in the list returned by the function.

语法

ListVersions (sde_workspace)
参数说明数据类型
sde_workspace

An ArcSDE geodatabase workspace.

String
返回值
数据类型说明
String

The Python List returned from the function containing version names in the ArcSDE geodatabase the connected user has permissions to use.

代码示例

ListVersions Example (Stand-alone Script)

Gets the list of versions the user has permissions to use and prints them.

# name: ListVersions.py
# Purpose: List all versions the connected user has permissions to connect to.
# Author: ESRI

# Import system modules
import arcpy

versionList = arcpy.ListVersions(r"Database Connections\toolboxDEFAULTVersion.sde")

# Print the versions available to the user
for version in versionList:
    print version

相关主题


7/10/2012