GetReturnCode (arcpy)
摘要
通过索引返回消息错误代码。
如果指定索引的消息是警告或信息性消息,函数将返回 0;如果消息是错误,函数将返回 0 以外的值。
语法
GetReturnCode (index)
| 参数 | 说明 | 数据类型 | 
| index | The specified position of the message in the returned list of messages, warnings, or errors. | Integer | 
| 数据类型 | 说明 | 
| Integer | 指定索引位置的消息的返回代码。 | 
代码实例
GetReturnCode 示例
返回指定消息的严重性代码。
import arcpy
from arcpy import env
env.workspace = "C:/census/data.gdb" 
arcpy.Erase_analysis("housing", "income", "low_income") 
# Return the return code of the message in index position 3 (4th message) 
# 
print arcpy.GetReturnCode(3)
相关主题
9/15/2013