Last change
on this file since 2031 was 1532, checked in by Malte Marquarding, 15 years ago |
autoexec doesn't work in ipython < 0.9; disbale color scheme
|
File size:
1.6 KB
|
Line | |
---|
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 | o = ip.options
|
---|
31 | o.autocall = 1
|
---|
32 | o.system_verbose = 0
|
---|
33 |
|
---|
34 | o.prompt_in1 = r'ASAP>'
|
---|
35 | #o.prompt_in2 = r' .%n.:'
|
---|
36 | o.prompt_in2 = r'.\D: '
|
---|
37 | o.prompt_out = r'asap>:'
|
---|
38 |
|
---|
39 | #o.autoexec.append('%colors Linux')
|
---|
40 | o.autocall = 2
|
---|
41 | o.pprint = 1
|
---|
42 | o.confirm_exit = 0
|
---|
43 | o.banner = 0
|
---|
44 | o.xmode = 'Plain'
|
---|
45 | o.readline_omit__names = 1
|
---|
46 | import_all("asap")
|
---|
47 | # asap banner
|
---|
48 | execf("~/.asap/asapuserfuncs.py")
|
---|
49 | ip.ex('print welcome()')
|
---|
50 |
|
---|
51 | # some config helper functions you can use
|
---|
52 | def import_all(modules):
|
---|
53 | """ Usage: import_all("os sys") """
|
---|
54 | for m in modules.split():
|
---|
55 | ip.ex("from %s import *" % m)
|
---|
56 |
|
---|
57 | def execf(fname):
|
---|
58 | """ Execute a file in user namespace """
|
---|
59 | ip.ex('execfile("%s")' % os.path.expanduser(fname))
|
---|
60 |
|
---|
61 | main()
|
---|
62 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.