##// END OF EJS Templates
fix SGE jobarray regex
fix SGE jobarray regex

File last commit:

r3966:9e6944d4
r4002:ce975089
Show More
ipython.txt
136 lines | 5.2 KiB | text/plain | TextLexer
Brian Granger
Major work on the documentation....
r2277 .. _configuring_ipython:
===========================================================
Configuring the :command:`ipython` command line application
===========================================================
This section contains information about how to configure the
:command:`ipython` command line application. See the :ref:`configuration
overview <config_overview>` for a more general description of the
configuration system and configuration file format.
The default configuration file for the :command:`ipython` command line application
is :file:`ipython_config.py`. By setting the attributes in this file, you
can configure the application. A sample is provided in
:mod:`IPython.config.default.ipython_config`. Simply copy this file to your
Darren Dale
Add a cross reference to discussion of ipython directory location.
r3830 :ref:`IPython directory <ipython_dir>` to start using it.
Brian Granger
Major work on the documentation....
r2277
Most configuration attributes that this file accepts are associated with
classes that are subclasses of :class:`~IPython.core.component.Component`.
A few configuration attributes are not associated with a particular
:class:`~IPython.core.component.Component` subclass. These are application
wide configuration attributes and are stored in the ``Global``
sub-configuration section. We begin with a description of these
attributes.
Global configuration
====================
Assuming that your configuration file has the following at the top::
c = get_config()
the following attributes can be set in the ``Global`` section.
MinRK
update docs with new cl-arguments
r3966 :attr:`c.IPythonApp.display_banner`
Brian Granger
Major work on the documentation....
r2277 A boolean that determined if the banner is printer when :command:`ipython`
is started.
MinRK
update docs with new cl-arguments
r3966 :attr:`c.IPythonApp.classic`
Brian Granger
Major work on the documentation....
r2277 A boolean that determines if IPython starts in "classic" mode. In this
mode, the prompts and everything mimic that of the normal :command:`python`
shell
MinRK
update docs with new cl-arguments
r3966 :attr:`c.IPythonApp.nosep`
Brian Granger
Major work on the documentation....
r2277 A boolean that determines if there should be no blank lines between
prompts.
MinRK
update docs with new cl-arguments
r3966 :attr:`c.IPythonApp.log_level`
Brian Granger
Major work on the documentation....
r2277 An integer that sets the detail of the logging level during the startup
of :command:`ipython`. The default is 30 and the possible values are
(0, 10, 20, 30, 40, 50). Higher is quieter and lower is more verbose.
MinRK
update docs with new cl-arguments
r3966 :attr:`c.IPythonApp.extensions`
Brian Granger
Major work on the documentation....
r2277 A list of strings, each of which is an importable IPython extension. An
IPython extension is a regular Python module or package that has a
Brian Granger
The pretty.py extension has been ported to the new extension API....
r2281 :func:`load_ipython_extension(ip)` method. This method gets called when
the extension is loaded with the currently running
Brian Granger
Major work on the documentation....
r2277 :class:`~IPython.core.iplib.InteractiveShell` as its only argument. You
can put your extensions anywhere they can be imported but we add the
:file:`extensions` subdirectory of the ipython directory to ``sys.path``
Brian Granger
The pretty.py extension has been ported to the new extension API....
r2281 during extension loading, so you can put them there as well. Extensions
are not executed in the user's interactive namespace and they must be pure
Python code. Extensions are the recommended way of customizing
:command:`ipython`. Extensions can provide an
:func:`unload_ipython_extension` that will be called when the extension is
unloaded.
Brian Granger
Major work on the documentation....
r2277
MinRK
update docs with new cl-arguments
r3966 :attr:`c.IPythonApp.exec_lines`
Brian Granger
Major work on the documentation....
r2277 A list of strings, each of which is Python code that is run in the user's
namespace after IPython start. These lines can contain full IPython syntax
with magics, etc.
MinRK
update docs with new cl-arguments
r3966 :attr:`c.IPythonApp.exec_files`
Brian Granger
Major work on the documentation....
r2277 A list of strings, each of which is the full pathname of a ``.py`` or
``.ipy`` file that will be executed as IPython starts. These files are run
in IPython in the user's namespace. Files with a ``.py`` extension need to
be pure Python. Files with a ``.ipy`` extension can have custom IPython
syntax (magics, etc.). These files need to be in the cwd, the ipythondir
or be absolute paths.
Classes that can be configured
==============================
The following classes can also be configured in the configuration file for
:command:`ipython`:
* :class:`~IPython.core.iplib.InteractiveShell`
* :class:`~IPython.core.prefilter.PrefilterManager`
* :class:`~IPython.core.alias.AliasManager`
To see which attributes of these classes are configurable, please see the
source code for these classes, the class docstrings or the sample
configuration file :mod:`IPython.config.default.ipython_config`.
Example
=======
For those who want to get a quick start, here is a sample
:file:`ipython_config.py` that sets some of the common configuration
attributes::
# sample ipython_config.py
c = get_config()
MinRK
update docs with new cl-arguments
r3966 c.IPythonApp.display_banner = True
c.IPythonApp.log_level = 20
c.IPythonApp.extensions = [
Brian Granger
Major work on the documentation....
r2277 'myextension'
]
MinRK
update docs with new cl-arguments
r3966 c.IPythonApp.exec_lines = [
Brian Granger
Major work on the documentation....
r2277 'import numpy',
'import scipy'
]
MinRK
update docs with new cl-arguments
r3966 c.IPythonApp.exec_files = [
Brian Granger
Major work on the documentation....
r2277 'mycode.py',
'fancy.ipy'
]
c.InteractiveShell.autoindent = True
c.InteractiveShell.colors = 'LightBG'
c.InteractiveShell.confirm_exit = False
c.InteractiveShell.deep_reload = True
c.InteractiveShell.editor = 'nano'
c.InteractiveShell.prompt_in1 = 'In [\#]: '
c.InteractiveShell.prompt_in2 = ' .\D.: '
c.InteractiveShell.prompt_out = 'Out[\#]: '
c.InteractiveShell.prompts_pad_left = True
c.InteractiveShell.xmode = 'Context'
c.PrefilterManager.multi_line_specials = True
c.AliasManager.user_aliases = [
('la', 'ls -al')
Brian Granger
Adding new docs for configuration/extensions/plugins.
r2749 ]