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