##// END OF EJS Templates
add some config helpers to ipy_user_conf.py
vivainio -
Show More
@@ -24,6 +24,8 b' ip = IPython.ipapi.get()'
24 24 # You probably want to uncomment this if you did %upgrade -nolegacy
25 25 # import ipy_defaults
26 26
27 import os
28
27 29 def main():
28 30 # Handy tab-completers for %cd, %run, import etc.
29 31 # Try commenting this out if you have completion problems/slowness
@@ -39,5 +41,18 b' def main():'
39 41 # An example on how to set options
40 42 #o.autocall = 1
41 43 o.system_verbose = 0
44
45 #import_all("os sys")
46 #execf('~/_ipython/ns.py')
47
48 # some config helper functions you can use
49 def import_all(modules):
50 """ Usage: import_all("os sys") """
51 for m in modules.split():
52 ip.ex("from %s import *" % m)
53
54 def execf(fname):
55 """ Execute a file in user namespace """
56 ip.ex('execfile("%s")' % os.path.expanduser(fname))
42 57
43 58 main()
General Comments 0
You need to be logged in to leave comments. Login now