Important

This documentation covers IPython versions 6.0 and higher. Beginning with version 6.0, IPython stopped supporting compatibility with Python versions lower than 3.3 including all versions of Python 2.7.

If you are looking for an IPython version compatible with Python 2.7, please use the IPython 5.x LTS release and refer to its documentation (LTS is the long term support release).

IPython

IPython: tools for interactive and parallel computing in Python.

https://ipython.org

3 Functions

IPython.embed_kernel(module=None, local_ns=None, **kwargs)

Embed and start an IPython kernel in a given scope.

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_kernel() instead.

Parameters:
  • module (ModuleType, optional) – The module to load into IPython globals (default: caller)
  • local_ns (dict, optional) – The namespace to load into IPython user namespace (default: caller)
  • kwargs (various, optional) – Further keyword args are relayed to the IPKernelApp constructor, allowing configuration of the Kernel. Will only have an effect on the first embed_kernel call for a given process.
IPython.start_ipython(argv=None, **kwargs)

Launch a normal IPython instance (as opposed to embedded)

IPython.embed() puts a shell in a particular calling scope, such as a function or method for debugging purposes, which is often not desirable.

start_ipython() does full, regular IPython initialization, including loading startup files, configuration, etc. much of which is skipped by embed().

This is a public API method, and will survive implementation changes.

Parameters:
  • argv (list or None, optional) – If unspecified or None, IPython will parse command-line options from sys.argv. To prevent any command-line parsing, pass an empty list: argv=[].
  • user_ns (dict, optional) – specify this dictionary to initialize the IPython user namespace with particular values.
  • kwargs (various, optional) – Any other kwargs will be passed to the Application constructor, such as config.
IPython.start_kernel(argv=None, **kwargs)

Launch a normal IPython kernel instance (as opposed to embedded)

IPython.embed_kernel() puts a shell in a particular calling scope, such as a function or method for debugging purposes, which is often not desirable.

start_kernel() does full, regular IPython initialization, including loading startup files, configuration, etc. much of which is skipped by embed().

Parameters:
  • argv (list or None, optional) – If unspecified or None, IPython will parse command-line options from sys.argv. To prevent any command-line parsing, pass an empty list: argv=[].
  • user_ns (dict, optional) – specify this dictionary to initialize the IPython user namespace with particular values.
  • kwargs (various, optional) – Any other kwargs will be passed to the Application constructor, such as config.