Shwouchk Shwouchk - 1 year ago 57
Bash Question

How can I launch ipython from shell, by running 'python ...'?

I would like to add some commandline options to a python launch code in order to actually invoke an ipython shell. How do I do that?

Answer Source

To start IPython from directly from Python you can do that:

python -c "from IPython import embed; embed()"

embed will use all local variables inside shell.

If you want to provide custom locals take a look at IPython.terminal.embed.InteractiveShellEmbed

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download