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


Python __builtin__.quit方法代码示例

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


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

示例1: __call__

# 需要导入模块: import __builtin__ [as 别名]
# 或者: from __builtin__ import quit [as 别名]
def __call__(self):
        self.__setup()
        prompt = 'Hit Return for more, or q (and Return) to quit: '
        lineno = 0
        while 1:
            try:
                for i in range(lineno, lineno + self.MAXLINES):
                    print self.__lines[i]
            except IndexError:
                break
            else:
                lineno += self.MAXLINES
                key = None
                while key is None:
                    key = raw_input(prompt)
                    if key not in ('', 'q'):
                        key = None
                if key == 'q':
                    break 
开发者ID:glmcdona,项目名称:meddle,代码行数:21,代码来源:site.py

示例2: __call__

# 需要导入模块: import __builtin__ [as 别名]
# 或者: from __builtin__ import quit [as 别名]
def __call__(self):
        self.__setup()
        prompt = 'Hit Return for more, or q (and Return) to quit: '
        lineno = 0
        while 1:
            try:
                for i in range(lineno, lineno + self.MAXLINES):
                    print(self.__lines[i])
            except IndexError:
                break
            else:
                lineno += self.MAXLINES
                key = None
                while key is None:
                    try:
                        key = raw_input(prompt)
                    except NameError:
                        key = input(prompt)
                    if key not in ('', 'q'):
                        key = None
                if key == 'q':
                    break 
开发者ID:awemulya,项目名称:kobo-predict,代码行数:24,代码来源:site.py

示例3: __call__

# 需要导入模块: import __builtin__ [as 别名]
# 或者: from __builtin__ import quit [as 别名]
def __call__(self):
        self.__setup()
        prompt = "Hit Return for more, or q (and Return) to quit: "
        lineno = 0
        while 1:
            try:
                for i in range(lineno, lineno + self.MAXLINES):
                    print(self.__lines[i])
            except IndexError:
                break
            else:
                lineno += self.MAXLINES
                key = None
                while key is None:
                    try:
                        key = raw_input(prompt)
                    except NameError:
                        key = input(prompt)
                    if key not in ("", "q"):
                        key = None
                if key == "q":
                    break 
开发者ID:QData,项目名称:deepWordBug,代码行数:24,代码来源:site.py

示例4: do_python

# 需要导入模块: import __builtin__ [as 别名]
# 或者: from __builtin__ import quit [as 别名]
def do_python(self,arg):
		""" start the local python interpreter (for debugging purposes) """
		orig_exit=builtins.exit
		orig_quit=builtins.quit
		def disabled_exit(*args, **kwargs):
			self.display_warning("exit() disabled ! use ctrl+D to exit the python shell")
		builtins.exit=disabled_exit
		builtins.quit=disabled_exit
		oldcompleter=readline.get_completer()
		try:
			local_ns={"pupsrv":self.pupsrv}
			readline.set_completer(PythonCompleter(local_ns=local_ns).complete)
			readline.parse_and_bind('tab: complete')
			code.interact(local=local_ns)
		except Exception as e:
			self.display_error(str(e))
		finally:
			readline.set_completer(oldcompleter)
			readline.parse_and_bind('tab: complete')
			builtins.exit=orig_exit
			builtins.quit=orig_quit 
开发者ID:krintoxi,项目名称:NoobSec-Toolkit,代码行数:23,代码来源:PupyCmd.py


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