New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot escape IPython.embed() when called repeatedly within function inside a for-loop #9149
Comments
This is use full in case where an IPython embed instance is created in a loop: from IPython import embed while True: embed(header="You will be stuck there") Now using `%raise_on_exist True` in an embeded shell allows the embeded instannce to raise on exit. Potential improvement would be flags to pass a custom exception type as well as a custom message to raise. Closes ipython#9149
This is use full in case where an IPython embed instance is created in a loop: from IPython import embed while True: embed(header="You will be stuck there") Now using `%raise_on_exist True` in an embeded shell allows the embeded instannce to raise on exit. Potential improvement would be flags to pass a custom exception type as well as a custom message to raise. Closes ipython#9149
Try |
It would be nice to have a single command that would completely stop the script's execution. Like the equivalent of:
|
|
@s2t2 exit is working with the current version. |
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
'sq
, which immediately throws an exception and exits to the CLI in whichfoo.py
was executed.The text was updated successfully, but these errors were encountered: