Skip to Content
Software Architecture with Python
book

Software Architecture with Python

by Anand Balachandran Pillai
April 2017
Intermediate to advanced
556 pages
11h 5m
English
Packt Publishing
Content preview from Software Architecture with Python

Debugging tools – using debuggers

Most programmers tend to think of debugging as something that they ought to do with a debugger. In this chapter, we have so far seen that, more than an exact science, debugging is an art, which can be done using a lot of tricks and techniques rather than directly jumping to a debugger. However, sooner or later, we expected to encounter the debugger in this chapter—and here we are!

The Python Debugger, or pdb as it is known, is part of the Python runtime.

Pdb can be invoked when running a script from the beginning as follows:

$ python3 -m pdb script.py

However, the most common way in which programmers invoke pdb is to insert the following line at a place in the code where you want to enter the debugger:

import pdb; ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Architecture Patterns with Python

Architecture Patterns with Python

Harry Percival, Bob Gregory

Publisher Resources

ISBN: 9781786468529Supplemental Content