Zusammenfassung
Returns a list of versions that the connected user has permission to use.
Diskussion
Specify the path to a connection file as an argument to the function, or set the workspace environment to the connection file and call the ListVersions function without arguments.
Hinweis:
The arcpy.ListVersions function is different from the arcpy.da.ListVersions function, which returns a list of Version objects.
Syntax
ListVersions (sde_workspace)
| Parameter | Erläuterung | Datentyp | 
| sde_workspace | An enterprise geodatabase workspace. | String | 
| Datentyp | Erläuterung | 
| String | A list of version names in the enterprise geodatabase that the connected user has permissions to use. | 
Codebeispiel
Get the list of versions the user has permissions to use and print them.
import arcpy
database = "Database Connections/toolboxDEFAULTVersion.sde"
versions = arcpy.ListVersions(database)
# Print the versions available to the user
for version in versions:
    print(version)