Reputation: 7419
If I start ipython notebook
from the command line IPython throws an exception with a long traceback and I want to run a debugger at the point where the exception is thrown.
I know IPythons magic command %debug
but this requires a Python script as argument. My current solution is insert import IPython; IPython.embedd()
or import pdb; pdb.set_trace()
manually, but I wonder if there is a better and noninstruive solution for this.
Is there a way to start the Python debugger automatically for command line tools which are implemented with setuptools entry point mechanism ?
Upvotes: 1
Views: 325
Reputation: 33046
IPython launcher is a Python script itself, so just run it in Python debugger:
python -m pdb /usr/bin/ipython notebook
Upvotes: 3