Debugging Python Applications with the PDB Module
Introduction
In this tutorial, we are going to learn how to use Python’s PDB module for debugging Python applications. Debugging refers to the process of removing software and hardware errors from a software application. PDB stands for “Python Debugger”, and is a built-in interactive source code debugger with a wide range of features, like pausing a program, viewing variable values at specific instances, changing those values, etc.
In this article, we will be covering the most commonly used functionalities of the PDB module.
Background
Debugging is one of the most disliked activities in software development, and at the same time, it is one of the most important tasks in the software development life cycle. At some stage, every programmer has to debug his/her code, unless he is developing a very basic software application.
There are many different ways to debug a software application. A very commonly used method is using the “print” statements at different instances of your code to see what is happening during execution. However, this method has many problems, such as the addition of extra code that is used to print the variables’ values, etc. While this approach might work for