1 """ User configuration file for IPython
3 This is a more flexible and safe way to configure ipython than *rc files
4 (ipythonrc, ipythonrc-pysh etc.)
6 This file is always imported on ipython startup. You can import the
7 ipython extensions you need here (see IPython/Extensions directory).
9 Feel free to edit this file to customize your ipython experience.
11 Note that as such this file does nothing, for backwards compatibility.
12 Consult e.g. file 'ipy_profile_sh.py' for an example of the things
15 See http://ipython.scipy.org/moin/IpythonExtensionApi for detailed
16 description on what you could do here.
19 # Most of your config files and extensions will probably start with this import
22 ip = IPython.ipapi.get()
24 # You probably want to uncomment this if you did %upgrade -nolegacy
31 # uncomment if you want to get ipython -p sh behaviour
32 # without having to use command line switches
33 # import ipy_profile_sh
35 # Configure your favourite editor?
36 # Good idea e.g. for %edit os.path.isfile
40 # Choose one of these:
43 #ipy_editors.scite('c:/opt/scite/scite.exe')
46 # ... or many others, try 'ipy_editors??' after import to see them
49 #ipy_editors.install_editor("c:/opt/jed +$line $file")
53 # An example on how to set options
58 #execf('~/_ipython/ns.py')
62 # A different, more compact set of prompts from the default ones, that
63 # always show your current location in the filesystem:
65 #o.prompt_in1 = r'\C_LightBlue[\C_LightCyan\Y2\C_LightBlue]\C_Normal\n\C_Green|\#>'
66 #o.prompt_in2 = r'.\D: '
67 #o.prompt_out = r'[\#] '
69 # Try one of these color settings if you can't read the text easily
70 # autoexec is a list of IPython commands to execute on startup
71 #o.autoexec.append('%colors LightBG')
72 #o.autoexec.append('%colors NoColor')
73 #o.autoexec.append('%colors Linux')
75 # for sane integer division that converts to float (1/2 == 0.5)
76 #o.autoexec.append('from __future__ import division')
78 # For %tasks and %kill
81 # For autoreloading of modules (%autoreload, %aimport)
82 #import ipy_autoreload
84 # For winpdb support (%wdb)
87 # For bzr completer, requires bzrlib (the python installation of bzr)
90 # Tab completer that is not quite so picky (i.e.
91 # "foo".<TAB> and str(2).<TAB> will work). Complete
93 #import ipy_greedycompleter
97 # some config helper functions you can use
98 def import_all(modules):
99 """ Usage: import_all("os sys") """
100 for m in modules.split():
101 ip.ex("from %s import *" % m)
104 """ Execute a file in user namespace """
105 ip.ex('execfile("%s")' % os.path.expanduser(fname))