##// END OF EJS Templates
Fixing sympy profile.
Brian Granger -
Show More
@@ -1,28 +1,29 b''
1 c = get_config()
1 c = get_config()
2
2
3 # This can be used at any point in a config file to load a sub config
3 # This can be used at any point in a config file to load a sub config
4 # and merge it into the current one.
4 # and merge it into the current one.
5 load_subconfig('ipython_config.py')
5 load_subconfig('ipython_config.py')
6
6
7 lines = """
7 lines = """
8 from __future__ import division
8 from __future__ import division
9 from sympy import *
9 from sympy import *
10 x, y, z = symbols('xyz')
10 x, y, z = symbols('xyz')
11 k, m, n = symbols('kmn', integer=True)
11 k, m, n = symbols('kmn', integer=True)
12 f, g, h = map(Function, 'fgh')
12 f, g, h = map(Function, 'fgh')
13 """
13 """
14
14
15 # You have to make sure that attributes that are containers already
15 # You have to make sure that attributes that are containers already
16 # exist before using them. Simple assigning a new list will override
16 # exist before using them. Simple assigning a new list will override
17 # all previous values.
17 # all previous values.
18
18
19 if hasattr(c.Global, 'exec_lines'):
19 if hasattr(c.Global, 'exec_lines'):
20 c.Global.exec_lines.append(lines)
20 c.Global.exec_lines.append(lines)
21 else:
21 else:
22 c.Global.exec_lines = [lines]
22 c.Global.exec_lines = [lines]
23
23
24 # Load the sympy_printing extension to enable nice printing of sympy expr's.
24 if hasattr(c.Global, 'extensions'):
25 if hasattr(c.Global, 'extensions'):
25 c.Global.extensions.append('IPython.extensions.sympy_printing')
26 c.Global.extensions.append('sympy_printing')
26 else:
27 else:
27 c.Global.extensions = ['IPython.extensions.sympy_printing']
28 c.Global.extensions = ['sympy_printing']
28
29
General Comments 0
You need to be logged in to leave comments. Login now