bundles / IPython 9.5.0 / IPython / terminal / embed / embed
function
IPython.terminal.embed:embed
source: /IPython/terminal/embed.py :357
Signature
def embed ( * , header = '' , compile_flags = None , ** kwargs ) Summary
Call this to embed IPython at the current point in your program.
Extended Summary
The first invocation of this will create a terminal.embed.InteractiveShellEmbed instance and then call it. Consecutive calls just call the already created instance.
If you don't want the kernel to initialize the namespace from the scope of the surrounding function, and/or you want to load full IPython configuration, you probably want IPython.start_ipython() instead.
Here is a simple example
from IPython import embed a = 10 b = 20 embed(header='First time') c = 30 d = 40 embed()
Parameters
header: strOptional header string to print at startup.
compile_flagsPassed to the
compile_flagsparameter ofterminal.embed.InteractiveShellEmbed.mainloop(), which is called when the terminal.embed.InteractiveShellEmbed instance is called.**kwargs: various, optionalAny other kwargs will be passed to the terminal.embed.InteractiveShellEmbed constructor. Full customization can be done by passing a traitlets
Configin as theconfigargument (seeconfigure_start_ipythonandterminal_options).
Aliases
-
IPython.embed
Referenced by
This package
- whatsnew:version0.13
- whatsnew:version1.0
- IPython:start_ipython
- IPython.core.magics.basic:AsyncMagics.autoawait
- whatsnew:version0.13
- whatsnew:version1.0
- IPython:start_ipython
- IPython.core.magics.basic:AsyncMagics.autoawait
- whatsnew:version0.13
- whatsnew:version1.0
- IPython:start_ipython
- IPython.core.magics.basic:AsyncMagics.autoawait
- whatsnew:version0.13
- whatsnew:version1.0
- IPython:start_ipython
- IPython.core.magics.basic:AsyncMagics.autoawait
- whatsnew:version0.13
- whatsnew:version1.0
- IPython:start_ipython
- IPython.core.magics.basic:AsyncMagics.autoawait
- whatsnew:version0.13
- whatsnew:version1.0
- IPython:start_ipython
- IPython.core.magics.basic:AsyncMagics.autoawait
- whatsnew:version0.13
- whatsnew:version1.0
- IPython:start_ipython
- IPython.core.magics.basic:AsyncMagics.autoawait