Describe object properties

Resumen

The Describe function returns the following properties for all Describe objects.

Propiedades

PropiedadExplicaciónTipo de datos
baseName
(Sólo lectura)

The file base name

String
catalogPath
(Sólo lectura)

The path of the data

String
children
(Sólo lectura)

A list of sub elements

Describe
childrenExpanded
(Sólo lectura)

Indicates whether the children have been expanded

Boolean
dataElementType
(Sólo lectura)

The element type of the element

String
dataType
(Sólo lectura)

The type of the element

String
extension
(Sólo lectura)

The file extension

String
file
(Sólo lectura)

The file name

String
fullPropsRetrieved
(Sólo lectura)

Indicates whether full properties have been retrieved

Boolean
metadataRetrieved
(Sólo lectura)

Indicates whether the metadata has been retrieved

Boolean
name
(Sólo lectura)

The user-assigned name for the element

String
path
(Sólo lectura)

The file path

String

Muestra de código

Describe object properties example (stand-alone script)

Display some Describe object properties for a file geodatabase.

import arcpy

# Create a Describe object
#
desc = arcpy.Describe("C:/Data/chesapeake.gdb")

# Print some Describe Object properties
#
if hasattr(desc, "name"):
    print("Name:        " + desc.name)
if hasattr(desc, "dataType"):
    print("DataType:    " + desc.dataType)
if hasattr(desc, "catalogPath"):
    print("CatalogPath: " + desc.catalogPath)

# Examine children and print their name and dataType
#
print("Children:")
for child in desc.children:
    print("\t%s = %s" % (child.name, child.dataType))