ListVersions (arcpy)

サマリ

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.

注意注意:

The arcpy.ListVersions function should not be confused with the arcpy.da.ListVersions function which is used to return a list of Version objects.

構文

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

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

import arcpy

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

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

関連トピック

9/14/2013