By default, during debugging in IPython, ipdb shows one line above and one line below the current position in code.
Is there an easy way to make the area shown a bit b
You can get more context by doing:
ipdb.set_trace(context=21)
(there's a bug introduced in 0.10.0 that breaks this, but it should be fixed soon)
To permanently set context size, find the installation directory by doing
python -c 'import ipdb; print(ipdb)'
which will show you a __init__.py
file. Open that file and find the line (which may also be found in IPDB's __main__.py
:
def set_trace(frame=None, context=3):
change the 3
to however many context lines you want.