[IPython-dev] Run code at startup
Sat Oct 29 18:57:10 CDT 2011
One of the commonest uses of config files is to specify code to be run in
IPython's startup, e.g. to define extra magic commands, or to import modules
in the user namespace. At present, this is a bit awkward: you can embed your
code within a string in exec_lines, or you can save it in a separate file
and add it to exec_files. In both cases, users might also get caught out by
the inheritance that allows separate or joint configuration of the terminal
and the ZMQShell.
I proposed in #914 that we offer a simpler way to do this. Min's written a
neat implementation that will check for .py and .ipy files in a directory
like .ipython/profile_default/startup/ . I think this is a big improvement -
if people want a custom magic command, they can simply drop a file into a
folder, without delving into the config at all. Does anyone see a reason not
to add this feature?
The code can be seen here:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-dev