Book Image

Practical Maya Programming with Python

By : Robert Galanakis
Book Image

Practical Maya Programming with Python

By: Robert Galanakis

Overview of this book

Table of Contents (17 chapters)
Practical Maya Programming with Python
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Summary


In this chapter we took a close at look at how Python's exceptions work. We defined what an exception is and learned that dealing with exceptions and errors is a fact of programming life. We examined in detail the interesting traceback type and the exc_info tuple. We learned a set of best practices for handling errors, and how those best practices apply to Maya.

We spent the rest of the chapter putting together an exception hook function that will send an e-mail if any unhandled exception occurs in code we care about. We closed the chapter by covering several ways we can potentially improve our exception hook.

In the next chapter, we'll look at two relatively unique features of Python: context managers and decorators. They will help us fill in several holes while programming Maya and be more Pythonic.