本文整理汇总了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
示例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);')
示例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)
示例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)")
示例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)
示例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
示例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);')
示例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;")
示例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)
示例10: _start
# 需要导入模块: from expect import Expect [as 别名]
# 或者: from expect.Expect import _start [as 别名]
def _start(self):
Expect._start(self)
示例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'))