Interactive Python Debugger¶
The ipdb program is an interactive debugger that allows you to execute a program in slow motion.
Install it with:
pip install ipdb
Then you can start your program in debugging mode from the terminal:
python -m ipdb dungeon_explorer.py
In ipdb you have a couple of keyboard shortcuts that allow you to navigate the programs execution:
command |
description |
|---|---|
|
execute the next line |
|
execute the next line. If it contains a function, step inside it |
|
set a breakpoint at line 57 |
|
continue execution until the next breakpoint |
|
list lots of lines around the current one |
|
print contents of the variable |
|
modify a variable |