O'Reilly logo

Programming ArcGIS 10.1 with Python Cookbook by Eric Pimpler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Returning individual messages with GetMessage()

While GetMessages() returns a list containing all messages from the last tool run, you can also get individual messages from the string using GetMessage().

Getting ready

Up to this point, we have been returning all messages generated by the tool. However, you can return individual messages to your user through the GetMessage() method, which takes an integer as a parameter indicating the particular message you'd like to retrieve. Each message generated by the tool is placed into a message list or array. We discussed list objects earlier in the book, so you'll remember that this is just a collection of some type of object. Just as a reminder: lists are zero-based, meaning that the first item in the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required