13

Debugging Techniques

In this chapter, we will cover the following recipes:

  • Learning Python interpreter basics
  • Debugging through logging
  • Debugging with breakpoints
  • Improving your debugging skills

Introduction

Writing code is not easy. Actually, it is very hard. Even the best programmer in the world can't foresee every possible alternative and flow of the code.

This means that executing our code will always produce surprises and unexpected behaviors. Some will be very evident, while others will be very subtle, but the ability to identify and remove these defects in the code is critical to building solid software.

These defects in software are known as bugs, and therefore removing them is called debugging.

Inspecting the code just by reading ...

Get Python Automation Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.