I am running foo.py
from the command line, and it includes a function has a for loop, inside of which is a function that has an IPython.embed() statement. This is to initialize an interpreter at that point within the function to have access to those local variables.
However, when trying to escape from the embedded interpreter, it only opens a new interpreter (presumably up to k times for the for loop), effectively locking that terminal.
It would be nice to have a command analogous to ipdb
's q
, which immediately throws an exception and exits to the CLI in which foo.py
was executed.
Try %kill_embedded
- it doesn't break out of your loop, but it should make all future calls to embed()
no-ops, so that the rest of your script executes to completion.
It would be nice to have a single command that would completely stop the script's execution. Like the equivalent of:
%kill_embedded
(and yes, sure about it)exit
%exit_raise
will raise an exception into the outer context and your code will exit
Most helpful comment
It would be nice to have a single command that would completely stop the script's execution. Like the equivalent of:
%kill_embedded
(and yes, sure about it)exit