コード例 #1
0
ファイル: maple.py プロジェクト: aaditya-thakkar/sage
    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)
コード例 #2
0
ファイル: maple.py プロジェクト: lackofentropy/sage
    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)
コード例 #3
0
ファイル: gap.py プロジェクト: bgxcpku/sagelib
 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 ''
コード例 #4
0
ファイル: gap.py プロジェクト: thalespaiva/sagelib
 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 ''
コード例 #5
0
ファイル: gap.py プロジェクト: bgxcpku/sagelib
    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):
        """
コード例 #6
0
ファイル: gap.py プロジェクト: thalespaiva/sagelib
    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):
        """