How to use the IPython debugger (ipdb)

This is a copy of Debugging with ipython and ipdb.

Debugging with ipython and ipdb

Make sure you have setuptools installed

Install ipython and ipdb

Place a breakpoint in your code

print 'Hello World!'
my_var = 10 / 3
import ipdb; ipdb.set_trace() # BREAKPOINT
print my_var

Run your code

python my_project.py

Use ipdb

Sample program with a bug

Hint: Use pprint

Recommended Posts

How to use the IPython debugger (ipdb)
How to use IPython
How to use the generator
How to use the decorator
How to use the zip function
How to use the ConfigParser module
[Linux] How to use the echo command
How to use the Linux grep command
How to use xml.etree.ElementTree
How to use Python-shell
How to use tf.data
How to use virtualenv
How to use image-match
How to use shogun
How to use Pandas 2
How to use Virtualenv
How to use numpy.vectorize
How to use pytest_report_header
How to use partial
How to use Bio.Phylo
How to use SymPy
How to use x-means
How to use WikiExtractor.py
How to use virtualenv
How to use Matplotlib
How to use iptables
How to use numpy
How to use venv
How to use dictionary {}
How to use Pyenv
How to use list []
How to use python-kabusapi
How to use OptParse
How to use return
How to use dotenv
How to use pyenv-virtualenv
How to use Go.mod
How to use imutils
How to use import
How to use the C library in Python
How to use MkDocs for the first time
How to use the graph drawing library Bokeh
How to use the Google Cloud Translation API
How to use the NHK program guide API
[Algorithm x Python] How to use the list
How to use Qt Designer
[IPython] How to Share IPython Notebook
How to use search sorted
[gensim] How to use Doc2Vec
python3: How to use bottle (2)
Understand how to use django-filter
[Python] How to use list 1
How to use the Raspberry Pi relay module Python
How to use FastAPI ③ OpenAPI
How to use Python argparse
How to use Pandas Rolling
[Note] How to use virtualenv
Linux user addition, how to use the useradd command
How to use redis-py Dictionaries
[Python] How to use the graph creation library Altair
How to use the grep command and frequent samples