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?
To start IPython shell directly in Python:
from IPython import embed
a = "I will be accessible in IPython shell!"
embed()
Or, to simply run it from command line:
$ python -c "from IPython import embed; embed()"
embed
will use all local variables inside shell.
If you want to provide custom locals (variables accessible in shell) take a look at IPython.terminal.embed.InteractiveShellEmbed