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 saw how Python decorators and context managers invert the subroutine and allow us to factor out common setup and teardown code. We learned how both of these techniques work, and when to apply them. We implemented several context managers that make programming Python in Maya a better experience. We closed by exploring some potential uses for decorators, and advanced topics for future investigation.

Context managers and decorators are two powerful features that will come up again and again throughout this book and as you program Python. It is well worth understanding what they have to offer, and we've only just scratched the surface in this chapter. As convenient as they are for mapping Maya's problems onto Pythonic idioms, they are just as useful when designing systems from scratch. Web frameworks in particular have been able to use decorators for amazing things.

In the next chapter we will change topics and look at creating graphical user interfaces for Maya. We...