GetMessages

Zusammenfassung

Returns the geoprocessing messages from a tool by a specified severity level.

Syntax

GetMessages ({severity})
ParameterErläuterungDatentyp
severity

Specifies the type of messages to be returned.

  • 0Informative, warning, and error messages are returned.
  • 1Only warning messages are returned.
  • 2Only error messages are returned.

Not specifying a severity level will return all types of messages.

(Der Standardwert ist 0)

Integer
Rückgabewert
DatentypErläuterung
String

The geoprocessing tool messages, separated by a newline ('\n').

Codebeispiel

GetMessages example

Returns the geoprocessing messages.

import arcpy

fc = arcpy.GetParameterAsText(0)
arcpy.GetCount_management(fc)

# Print all of the geoprocessing messages returned by the
#  last tool (GetCount)
print(arcpy.GetMessages())

Verwandte Themen