0

When I do:

from IPython import embed
embed()

the console shows a strange prompt and the shell is not working properly. I know that pydev itself uses IPython but some other shell (like web2py interactive shell) also do that and it won't work.

In a console embedding IPython recursively many times works well.

Any idea to get it work?

Thanks, Gergely

2 Answers 2

2

It doesn't work because the console in PyDev is not a real tty replacement (which IPython expects to work properly).

So, ideally, if just for using IPython for dev you want to do, you can use the PyDev interactive interpreter: http://pydev.org/manual_adv_interactive_console.html which is properly integrated in PyDev.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for your answer, Fabio. Ok, it doesn't work with embed, but Pydev itself uses IPython if it's available, so there must be some workaround.
In PyDev, it actually creates a different process and does xml-rpc communication instead of putting things directly in the console.
0

Embedding another IPython shell within another IPython shell is now supported as of 3.0 - the I upstreamed patches for it last year.

Specifically you can do the following to your hearts content, from whatever IPython instance you are in, provided the default command shell works:

from IPython import embed; embed()

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.