# Put a breakpoint in a file that is not part of our code # Ref: https://stackoverflow.com/q/13589736/593722 (Pdb) import sys (Pdb) sys.path.append("/home/user/path/to/another/module") (Pdb) import another_module (Pdb) b another_module:356 Breakpoint 1 at /home/user/path/to/another/module/another_module.py:356 (Pdb) c # Conditionally hit the breakpoint #1 (Pdb) conditions 1 some_variable == some_value # Watch a variable when you are hitting breakpoint #1. And ensure the breakpoint is only hit whenever the variable takes a certain value. # Ref: https://stackoverflow.com/a/34620310/593722 (Pdb) commands 1 (com) print(some_variable) (com) end