Using the GitHub repository for this book
All the code samples in this book are hosted in a GitHub repository at https://github.com/rgalanakis/practicalmayapython. There are folders for the code in each chapter and appendix. In many cases, there is some divergence between code in the book and the source code, usually done to avoid duplication or to remove clutter, but it should be easy to find the source code for the chapter samples.
In general, running a file through the mayapy interpreter should execute the code and/or tests in the file. Code entered at the interactive prompt is usually in the interactive.py
file in the chapter's directory. Most functions that can be tested automatically have unit tests written. Code for GUIs, which cannot be automatically tested so easily, should be simple enough to run by copying and pasting the code into the Script Editor and then executing it. To make examples more clear and concrete, many paths are hard-coded. You will need to change those paths...