Describe object properties

サマリ

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

プロパティ

プロパティ説明データ タイプ
baseName
(読み取り専用)

The file base name

String
catalogPath
(読み取り専用)

The path of the data

String
children
(読み取り専用)

A list of sub elements

Describe
childrenExpanded
(読み取り専用)

Indicates whether the children have been expanded

Boolean
dataElementType
(読み取り専用)

The element type of the element

String
dataType
(読み取り専用)

The type of the element

String
extension
(読み取り専用)

The file extension

String
file
(読み取り専用)

The file name

String
fullPropsRetrieved
(読み取り専用)

Indicates whether full properties have been retrieved

Boolean
metadataRetrieved
(読み取り専用)

Indicates whether the metadata has been retrieved

Boolean
name
(読み取り専用)

The user-assigned name for the element

String
path
(読み取り専用)

The file path

String

コードのサンプル

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)



7/10/2012