def _eval_line_using_file(self, line, *args, **kwargs): """ EXAMPLES:: sage: maple._eval_line_using_file('2+2') # optional - maple '4' """ line += ';' # Adds the maple ";" thing like in self._eval_line return Expect._eval_line_using_file(self, line, *args, **kwargs)
def _eval_line_using_file(self, line): i = line.find(':=') if i != -1: j = line.find('"') if j >= 0 and j < i: i = -1 if i == -1: line0 = 'Print( %s );'%line.rstrip().rstrip(';') try: # this is necessary, since Print requires something as input, and some functions (e.g., Read) return nothing. return Expect._eval_line_using_file(self, line0) except RuntimeError, msg: #if not ("Function call: <func> must return a value" in msg): # raise RuntimeError, msg return ''
def _eval_line_using_file(self, line): i = line.find(':=') if i != -1: j = line.find('"') if j >= 0 and j < i: i = -1 if i == -1: line0 = 'Print( %s );' % line.rstrip().rstrip(';') try: # this is necessary, since Print requires something as input, and some functions (e.g., Read) return nothing. return Expect._eval_line_using_file(self, line0) except RuntimeError, msg: #if not ("Function call: <func> must return a value" in msg): # raise RuntimeError, msg return ''
def _eval_line_using_file(self, line): i = line.find(':=') if i != -1: j = line.find('"') if j >= 0 and j < i: i = -1 if i == -1: line0 = 'Print( %s );'%line.rstrip().rstrip(';') try: # this is necessary, since Print requires something as input, and some functions (e.g., Read) return nothing. return Expect._eval_line_using_file(self, line0) except RuntimeError, msg: #if not ("Function call: <func> must return a value" in msg): # raise RuntimeError, msg return '' return Expect._eval_line_using_file(self, line) def console(self): """ Spawn a new GAP command-line session. EXAMPLES:: sage: gap.console() #not tested GAP4, Version: 4.4.12 of 17-Dec-2008, powerpc-apple-darwin9.8.0-gcc gap> """ gap_console() def _object_class(self): """
def _eval_line_using_file(self, line): i = line.find(':=') if i != -1: j = line.find('"') if j >= 0 and j < i: i = -1 if i == -1: line0 = 'Print( %s );' % line.rstrip().rstrip(';') try: # this is necessary, since Print requires something as input, and some functions (e.g., Read) return nothing. return Expect._eval_line_using_file(self, line0) except RuntimeError, msg: #if not ("Function call: <func> must return a value" in msg): # raise RuntimeError, msg return '' return Expect._eval_line_using_file(self, line) def console(self): """ Spawn a new GAP command-line session. EXAMPLES:: sage: gap.console() #not tested GAP4, Version: 4.4.12 of 17-Dec-2008, powerpc-apple-darwin9.8.0-gcc gap> """ gap_console() def _object_class(self): """