ipython/ipython — Issue #914: Simpler system for running code after InteractiveShell is initialised
Author: takluyver
Created: 2011-10-20 23:52:40+00:00
State: open

A very common need for config is to run code after the InteractiveShell is initialised - e.g. to define extra magics or aliases, or to import modules. Currently, the user has to track down `exec_lines` in the config file, and put their code inside a string (i.e. it doesn't get syntax highlighted etc.), or save a file in a suitable place, and add it to exec_files.

I propose either:
- A file in the profile directory which is automatically run in the shell if it is present, as an addition to the user-specified exec_files. Something like `ipython_startup.py`.
- A directory, similar to the `/etc/rcN.d/` folders on Linux, in which any files found are run in a predictable order (i.e. to allow prefixes 00-99 if desired). This would allow customisations to be easily distributed: download a file, drop it in your `IPYTHONDIR/profile_default/startup/` directory, and an extra magic function will be available.