Skip to content
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

Use pre-mortem ipdb from inside IPython.embed #290

Open
anbjork opened this issue Dec 18, 2024 · 0 comments
Open

Use pre-mortem ipdb from inside IPython.embed #290

anbjork opened this issue Dec 18, 2024 · 0 comments

Comments

@anbjork
Copy link

anbjork commented Dec 18, 2024

When working with Python scripts that take a bit longer to run, I like to use
from IPython import embed; embed(colors = 'Linux')

From the embedded session, I often find myself wanting to step through functions to inspect what happens inside, and using the debugger for this would be fantastic since it would save me from editing them to put in additional embed()s, and pasting large chunks of code or reloading the modules if they come from a package.

However, I cannot make it work. When using
%debug [statement]
, it doesn't find things in my namespace and so I get NameError. When I use
ipdb.run('statement')
I get the error

You are currently into an embedded ipython shell,
the configuration will not be loaded.

Any advice, or an explanation of why what I want is impossible or not a good idea?

@anbjork anbjork changed the title use pre-mortem ipdb from inside IPython.embed Use pre-mortem ipdb from inside IPython.embed Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant