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
If you want to stop execution in a running system, as others said, use:
ipdb.set_trace(context=number_of_lines)
For running some function or an object's method modifying this context lines is a little bit tricky. The only way I found was:
ipdb.__main__._init_pdb(context=number_of_lines).runcall(callable, *args, **kwargs)
In case it serves someone.