Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagesmc
Path: blob/master/src/sage/all_cmdline.py
8814 views
1
"""
2
all_cmdline.py
3
4
This is all.py (load all sage functions) plus set-up for the Sage commandline.
5
"""
6
7
#############################################################################
8
# Copyright (C) 2007 William Stein <[email protected]>
9
# Distributed under the terms of the GNU General Public License (GPL)
10
# The full text of the GPL is available at:
11
# http://www.gnu.org/licenses/
12
#############################################################################
13
14
sage_mode = 'cmdline'
15
16
try:
17
18
from sage.all import *
19
from sage.calculus.predefined import x
20
21
except ValueError as msg:
22
import traceback
23
t = traceback.format_exc()
24
print t
25
if 'type object' in str(msg):
26
msg = str(msg) + """
27
28
** In Sage, the easiest fix for this problem is to type "sage -ba"
29
to rebuild all the Cython code (this takes several minutes).
30
Alternatively, touch the last .pyx file in the traceback above. **
31
"""
32
raise ValueError(msg)
33
34
sage.misc.session.init()
35
36
37