当前位置: 首页>>代码示例>>Python>>正文


Python Expect._start方法代码示例

本文整理汇总了Python中expect.Expect._start方法的典型用法代码示例。如果您正苦于以下问题:Python Expect._start方法的具体用法?Python Expect._start怎么用?Python Expect._start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在expect.Expect的用法示例。


在下文中一共展示了Expect._start方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _start

# 需要导入模块: from expect import Expect [as 别名]
# 或者: from expect.Expect import _start [as 别名]
 def _start(self):
     """
     EXAMPLES::
     
         sage: g = Gap()
         sage: g.is_running()
         False
         sage: g._start()
         sage: g.is_running()
         True
         sage: g.quit()
     """
     if self.__use_workspace_cache and not os.path.exists(WORKSPACE):
         gap_reset_workspace()
     global first_try
     n = self._session_number
     try:
         Expect._start(self, "Failed to start GAP.")
     except Exception, msg:
         if self.__use_workspace_cache and first_try:
             print "A workspace appears to have been corrupted... automatically rebuilding (this is harmless)."
             first_try = False
             self._expect = None
             expect.failed_to_start.remove(self.name())
             gap_reset_workspace(verbose=False)
             Expect._start(self, "Failed to start GAP.")
             self._session_number = n 
             return
         raise RuntimeError, msg
开发者ID:bgxcpku,项目名称:sagelib,代码行数:31,代码来源:gap.py

示例2: _start

# 需要导入模块: from expect import Expect [as 别名]
# 或者: from expect.Expect import _start [as 别名]
 def _start(self):
     try:
         Expect._start(self)
     except RuntimeError:
         raise RuntimeError, "You must install the optional Kash package to use Kash from Sage."
     # Turn off the annoying timer.
     self.eval('Time(false);')
开发者ID:bgxcpku,项目名称:sagelib,代码行数:9,代码来源:kash.py

示例3: _start

# 需要导入模块: from expect import Expect [as 别名]
# 或者: from expect.Expect import _start [as 别名]
    def _start(self):
        """
        Starts the Maxima interpreter.

        EXAMPLES::

            sage: m = Maxima()
            sage: m.is_running()
            False
            sage: m._start()
            sage: m.is_running()
            True

        Test that we can use more than 256MB RAM (see :trac:`6772`)::

            sage: a = maxima(10)^(10^5)
            sage: b = a^600              # long time -- about 10-15 seconds

        """
        Expect._start(self)
        self._sendline(r":lisp (defun tex-derivative (x l r) (tex (if $derivabbrev (tex-dabbrev x) (tex-d x '\\partial)) l r lop rop ))")

        # Don't use ! for factorials (#11539)
        self._sendline(":lisp (remprop 'mfactorial 'grind)")

        # Remove limit on the max heapsize (since otherwise it defaults
        # to 256MB with ECL).
        self._sendline(":lisp (ext:set-limit 'ext:heap-size 0)")
        self._eval_line('0;')

        # set random seed
        self.set_seed(self._seed)
开发者ID:sensen1,项目名称:sage,代码行数:34,代码来源:maxima.py

示例4: _start

# 需要导入模块: from expect import Expect [as 别名]
# 或者: from expect.Expect import _start [as 别名]
    def _start(self):
        """
        Starts Scilab and sets some options.

        EXAMPLES:
            sage: scilab._start()                       # optional - scilab
        """
        Expect._start(self)
        self.eval("mode(0)")
开发者ID:sageb0t,项目名称:testsage,代码行数:11,代码来源:scilab.py

示例5: _start

# 需要导入模块: from expect import Expect [as 别名]
# 或者: from expect.Expect import _start [as 别名]
    def _start(self, alt_message=None, block_during_init=True):
        r"""
        Restart the underlying process.

        .. note:: This is handled by the Expect class, except that we
           need to reset the breakloop configuration parameter.
        """
        Expect._start(self, alt_message=alt_message, block_during_init=block_during_init)
        self.set_default('breakloop',0)
开发者ID:robertzk,项目名称:lmfdb,代码行数:11,代码来源:gp.py

示例6: _start

# 需要导入模块: from expect import Expect [as 别名]
# 或者: from expect.Expect import _start [as 别名]
 def _start(self, *args, **kwds):
     """
     EXAMPLES:
         sage: l = Lisp()
         sage: l.is_running()
         False
         sage: l._start()
         sage: l.is_running()
         True
     """
     Expect._start(self, *args, **kwds)
     self.__in_seq = 1
开发者ID:pombredanne,项目名称:spd_notebook,代码行数:14,代码来源:lisp.py

示例7: _start

# 需要导入模块: from expect import Expect [as 别名]
# 或者: from expect.Expect import _start [as 别名]
 def _start(self, alt_message=None, block_during_init=True):
     Expect._start(self, alt_message, block_during_init)
     # disable timer
     self._eval_line('default(timer,0);')
     # disable the break loop, otherwise gp will seem to hang on errors
     self._eval_line('default(breakloop,0);')
     # list of directories where gp will look for scripts (only current working directory)
     self._eval_line('default(path,".");')
     # location of elldata, seadata, galdata
     self._eval_line('default(datadir, "$SAGE_LOCAL/share/pari");')
     # executable for gp ?? help
     self._eval_line('default(help, "$SAGE_LOCAL/bin/gphelp -detex");')
     # logfile disabled since Expect already logs
     self._eval_line('default(log,0);')
开发者ID:BlairArchibald,项目名称:sage,代码行数:16,代码来源:gp.py

示例8: _start

# 需要导入模块: from expect import Expect [as 别名]
# 或者: from expect.Expect import _start [as 别名]
 def _start(self):
     """
     Starts the Octave process.
     
     EXAMPLES::
     
         sage: o = Octave()    # optional - octave
         sage: o.is_running()  # optional - octave
         False
         sage: o._start()      # optional - octave
         sage: o.is_running()  # optional - octave
         True
     """
     Expect._start(self)
     self.eval("page_screen_output=0;")
     self.eval("format none;")
开发者ID:pombredanne,项目名称:sage-1,代码行数:18,代码来源:octave.py

示例9: _start

# 需要导入模块: from expect import Expect [as 别名]
# 或者: from expect.Expect import _start [as 别名]
 def _start(self):
     """
     Start the Axiom interpreter.
     
     EXAMPLES::
     
         sage: a = Axiom()
         sage: a.is_running()
         False
         sage: a._start()     #optional - axiom
         sage: a.is_running() #optional - axiom
         True
         sage: a.quit()       #optional - axiom
     """
     Expect._start(self)
     out = self._eval_line(')set functions compile on', reformat=False)
     out = self._eval_line(')set output length 245', reformat=False)
     out = self._eval_line(')set message autoload off', reformat=False)
开发者ID:williamstein,项目名称:sagelib,代码行数:20,代码来源:axiom.py

示例10: _start

# 需要导入模块: from expect import Expect [as 别名]
# 或者: from expect.Expect import _start [as 别名]
 def _start(self):
     Expect._start(self)
开发者ID:Etn40ff,项目名称:sage,代码行数:4,代码来源:matlab.py

示例11: _start

# 需要导入模块: from expect import Expect [as 别名]
# 或者: from expect.Expect import _start [as 别名]
 def _start(self):
     Expect._start(self)
     self.locals = sage_eval('globals()', cmds='load "%s"'%(nlgf_dir + 'prelude.sage'))
开发者ID:GrammaticalFramework,项目名称:gf-contrib,代码行数:5,代码来源:nlgf.py


注:本文中的expect.Expect._start方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。