This section contains information about how to configure the ipython command line application. See the configuration overview for a more general description of the configuration system and configuration file format.
The default configuration file for the ipython command line application is profile_default/ipython_config.py in your IPython directory. By setting the attributes in this file, you can configure the application. To create the default config file, run this command:
$ ipython profile create
Most configuration attributes that this file accepts are associated with classes that are subclasses of Configurable.
Applications themselves are Configurable as well, so we will start with some application-level config.
Assuming that your configuration file has the following at the top:
c = get_config()
the following attributes are set application-wide:
terminal IPython-only flags:
Some options, such as extensions and startup code, can be set for any application that starts an InteractiveShell. These apps are subclasses of InteractiveShellApp. Since subclasses inherit configuration, setting a trait of c.InteractiveShellApp will affect all IPython applications, but if you want terminal IPython and the QtConsole to have different values, you can set them via c.TerminalIPythonApp and c.IPKernelApp respectively.
The following classes can also be configured in the configuration file for ipython:
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 IPython.config.default.ipython_config.
For those who want to get a quick start, here is a sample ipython_config.py that sets some of the common configuration attributes:
# sample ipython_config.py
c = get_config()
c.TerminalIPythonApp.display_banner = True
c.InteractiveShellApp.log_level = 20
c.InteractiveShellApp.extensions = [
'myextension'
]
c.InteractiveShellApp.exec_lines = [
'import numpy',
'import scipy'
]
c.InteractiveShellApp.exec_files = [
'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.xmode = 'Context'
c.PromptManager.in_template = 'In [\#]: '
c.PromptManager.in2_template = ' .\D.: '
c.PromptManager.out_template = 'Out[\#]: '
c.PromptManager.justify = True
c.PrefilterManager.multi_line_specials = True
c.AliasManager.user_aliases = [
('la', 'ls -al')
]