Book Image

Panda3D 1.7 Game Developer's Cookbook

Book Image

Panda3D 1.7 Game Developer's Cookbook

Overview of this book

Table of Contents (20 chapters)
Panda3D 1.7 Game Developer's Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Debugging Python code


As already stated in the introduction to this chapter, knowing the debugger of the language you are developing in and how to put it to use is part of the bread-and-butter business of a programmer, just like writing the code in the first place. In case of Python, this means knowing how to use the pdb debugger, which will be introduced throughout the course of this recipe.

The pdb debugger operates as an interactive prompt, accepting simple text commands that trigger actions like advancing program execution, or setting break points that stop program execution at a given line. In the following tasks, you will be walked through an example debug session, teaching you all the commands needed for analyzing code and hunting down those nasty bugs!

However, note that pdb is not the only debugger available for Python. There are plenty of alternatives available like pydbgr, pudb, or Winpdb that might provide more features or a user interface that's easier to use. Though the big plus...