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).
Module: core.shellapp
¶
A mixin for Application
classes that
launch InteractiveShell instances, load extensions, etc.
1 Class¶
- class IPython.core.shellapp.InteractiveShellApp(**kwargs: Any)¶
Bases:
Configurable
A Mixin for applications that start InteractiveShell instances.
Provides configurables for loading extensions and executing files as part of configuring a Shell environment.
The following methods should be called by the
initialize()
method of the subclass:init_shell()
(to be implemented by the subclass)
- code_to_run¶
Execute the given command string.
- exec_PYTHONSTARTUP¶
Run the file referenced by the PYTHONSTARTUP environment variable at IPython startup.
- exec_files¶
List of files to run at IPython startup.
- exec_lines¶
lines of code to run at IPython startup.
- extensions¶
A list of dotted module names of IPython extensions to load.
- extra_extension¶
DEPRECATED. Dotted module name of a single extra IPython extension to load.
Only one extension can be added this way.
Only used with traitlets < 5.0, plural extra_extensions list is used in traitlets 5.
- extra_extensions¶
Dotted module name(s) of one or more IPython extensions to load.
For specifying extra extensions to load on the command-line.
Added in version 7.10.
- file_to_run¶
A file to be run
- gui¶
Enable GUI event loop integration with any of (‘asyncio’, ‘glut’, ‘gtk’, ‘gtk2’, ‘gtk3’, ‘gtk4’, ‘osx’, ‘pyglet’, ‘qt’, ‘qt4’, ‘qt5’, ‘qt6’, ‘tk’, ‘wx’, ‘gtk2’, ‘qt4’).
- hide_initial_ns¶
Should variables loaded at startup (by startup files, exec_lines, etc.) be hidden from tools like %who?
- ignore_cwd¶
If True, IPython will not add the current working directory to sys.path. When False, the current working directory is added to sys.path, allowing imports of modules defined in the current directory.
- init_code()¶
run the pre-flight code, specified via exec_lines
- init_extensions()¶
Load all IPython extensions in IPythonApp.extensions.
This uses the
ExtensionManager.load_extensions()
to load all the extensions listed inself.extensions
.
- init_gui_pylab()¶
Enable GUI event loop integration, taking pylab into account.
- init_path()¶
Add current working directory, ‘’, to sys.path
Unlike Python’s default, we insert before the first
site-packages
ordist-packages
directory, so that it is after the standard library.Changed in version 7.2: Try to insert after the standard library, instead of first.
Changed in version 8.0: Allow optionally not including the current directory in sys.path
- matplotlib¶
Configure matplotlib for interactive use with the default matplotlib backend.
- module_to_run¶
Run the module as a script.
- pylab¶
Pre-load matplotlib and numpy for interactive use, selecting a particular matplotlib backend and loop integration.
- pylab_import_all¶
If true, IPython will populate the user namespace with numpy, pylab, etc. and an
import *
is done from numpy and pylab, when using pylab mode.When False, pylab mode should not import any names into the user namespace.
- reraise_ipython_extension_failures¶
Reraise exceptions encountered loading IPython extensions?