Skip to main content

GetMessage

汇总

按索引位置返回地理处理工具消息。

语法

GetMessage(index)

参数 说明 数据类型

index

The message to retrieve.

Integer

返回值

数据类型 说明

String

地理处理工具消息。

代码示例

GetMessage 示例

返回指定的地理处理消息。

import arcpy

fc = arcpy.GetParameterAsText(0)

arcpy.management.GetCount(fc)

# Print the first and last message returned by the last
# tool run (GetCount).
message_count = arcpy.GetMessageCount()
print(arcpy.GetMessage(0))
print(arcpy.GetMessage(message_count - 1))