comparison .ipython/ipy_user_conf.py @ 148:c1519e52dcd0

Upgraded to newer ipython configuration.
author Augie Fackler <durin42@gmail.com>
date Sat, 26 Sep 2009 19:52:43 -0400
parents
children
comparison
equal deleted inserted replaced
147:6d95039c6544 148:c1519e52dcd0
1 """ User configuration file for IPython
2
3 This is a more flexible and safe way to configure ipython than *rc files
4 (ipythonrc, ipythonrc-pysh etc.)
5
6 This file is always imported on ipython startup. You can import the
7 ipython extensions you need here (see IPython/Extensions directory).
8
9 Feel free to edit this file to customize your ipython experience.
10
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
13 you can do here.
14
15 See http://ipython.scipy.org/moin/IpythonExtensionApi for detailed
16 description on what you could do here.
17 """
18
19 # Most of your config files and extensions will probably start with this import
20
21 import IPython.ipapi
22 ip = IPython.ipapi.get()
23
24 # You probably want to uncomment this if you did %upgrade -nolegacy
25 # import ipy_defaults
26
27 import os
28
29 def main():
30
31 # uncomment if you want to get ipython -p sh behaviour
32 # without having to use command line switches
33 # import ipy_profile_sh
34
35 # Configure your favourite editor?
36 # Good idea e.g. for %edit os.path.isfile
37
38 #import ipy_editors
39
40 # Choose one of these:
41
42 #ipy_editors.scite()
43 #ipy_editors.scite('c:/opt/scite/scite.exe')
44 #ipy_editors.komodo()
45 #ipy_editors.idle()
46 # ... or many others, try 'ipy_editors??' after import to see them
47
48 # Or roll your own:
49 #ipy_editors.install_editor("c:/opt/jed +$line $file")
50
51
52 o = ip.options
53 # An example on how to set options
54 #o.autocall = 1
55 o.system_verbose = 0
56
57 #import_all("os sys")
58 #execf('~/_ipython/ns.py')
59
60
61 # -- prompt
62 # A different, more compact set of prompts from the default ones, that
63 # always show your current location in the filesystem:
64
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'[\#] '
68
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')
74
75 # for sane integer division that converts to float (1/2 == 0.5)
76 #o.autoexec.append('from __future__ import division')
77
78 # For %tasks and %kill
79 #import jobctrl
80
81 # For autoreloading of modules (%autoreload, %aimport)
82 #import ipy_autoreload
83
84 # For winpdb support (%wdb)
85 #import ipy_winpdb
86
87 # For bzr completer, requires bzrlib (the python installation of bzr)
88 #ip.load('ipy_bzr')
89
90 # Tab completer that is not quite so picky (i.e.
91 # "foo".<TAB> and str(2).<TAB> will work). Complete
92 # at your own risk!
93 #import ipy_greedycompleter
94
95 # If you are on Linux, you may be annoyed by
96 # "Display all N possibilities? (y or n)" on tab completion,
97 # as well as the paging through "more". Uncomment the following
98 # lines to disable that behaviour
99 #import readline
100 #readline.parse_and_bind('set completion-query-items 1000')
101 #readline.parse_and_bind('set page-completions no')
102
103
104 # some config helper functions you can use
105 def import_all(modules):
106 """ Usage: import_all("os sys") """
107 for m in modules.split():
108 ip.ex("from %s import *" % m)
109
110 def execf(fname):
111 """ Execute a file in user namespace """
112 ip.ex('execfile("%s")' % os.path.expanduser(fname))
113
114 main()