Zusammenfassung
The Describe function returns the following properties for all Describe objects.
Eigenschaften
Eigenschaft | Erläuterung | Datentyp |
baseName (Nur lesen) | The file base name | String |
catalogPath (Nur lesen) | The path of the data | String |
children (Nur lesen) | A list of sub elements | Describe |
childrenExpanded (Nur lesen) | Indicates whether the children have been expanded | Boolean |
dataElementType (Nur lesen) | The element type of the element | String |
dataType (Nur lesen) | The type of the element | String |
extension (Nur lesen) | The file extension | String |
file (Nur lesen) | The file name | String |
fullPropsRetrieved (Nur lesen) | Indicates whether full properties have been retrieved | Boolean |
metadataRetrieved (Nur lesen) | Indicates whether the metadata has been retrieved | Boolean |
name (Nur lesen) | The user-assigned name for the element | String |
path (Nur lesen) | The file path | String |
Codebeispiel
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)