Book Image

Python Tools for Visual Studio

Book Image

Python Tools for Visual Studio

Overview of this book

Table of Contents (13 chapters)

Debugging


Visual Studio offers a large set of debugging tools; PTVS inherits a lot of them, which helps Python developers to debug code by using step-by-step execution, runtime variable watch capabilities, breakpoints, and the ability to see where the code fails during a debugging session.

The ability to see where the code breaks can significantly speed up the debugging session. In the following screenshot, we can see an example of an untracked exception:

An example of error dialog box during debugging a Python application

When you run the code, Visual Studio will stop the execution because it detects the raised exception of a problematic code. It highlights the exact point where the error occurred while also suggesting ways to fix it—even if right now Visual Studio may not suggest useful solutions for the problem.

The debugging process is not only about understanding where exceptions are raised, but also to understand what happens in the code when it is not behaving as expected. This is where...