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


Python TerminalInteractiveShell.mainloop方法代码示例

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


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

示例1: interactive

# 需要导入模块: from IPython.frontend.terminal.interactiveshell import TerminalInteractiveShell [as 别名]
# 或者: from IPython.frontend.terminal.interactiveshell.TerminalInteractiveShell import mainloop [as 别名]
def interactive(idx=0, DongleClass=RfCat, intro=''):
    global d
    import rflib.chipcon_nic as rfnic
    import atexit

    d = DongleClass(idx=idx)
    d.setModeRX()       # this puts the dongle into receive mode
    atexit.register(cleanupInteractiveAtExit)

    gbls = globals()
    lcls = locals()

    try:
        import IPython.Shell
        ipsh = IPython.Shell.IPShell(argv=[''], user_ns=lcls, user_global_ns=gbls)
        print intro
        ipsh.mainloop(intro)

    except ImportError, e:
        try:
            from IPython.frontend.terminal.interactiveshell import TerminalInteractiveShell
            ipsh = TerminalInteractiveShell()
            ipsh.user_global_ns.update(gbls)
            ipsh.user_global_ns.update(lcls)
            ipsh.autocall = 2       # don't require parenthesis around *everything*.  be smart!
            ipsh.mainloop(intro)
        except ImportError, e:
            print e
            shell = code.InteractiveConsole(gbls)
            shell.interact(intro)
开发者ID:WindyOrgUK,项目名称:rfcat,代码行数:32,代码来源:__init__.py

示例2: handle

# 需要导入模块: from IPython.frontend.terminal.interactiveshell import TerminalInteractiveShell [as 别名]
# 或者: from IPython.frontend.terminal.interactiveshell.TerminalInteractiveShell import mainloop [as 别名]
    def handle(self, *args, **kwargs):
        imported_objects = {
            'config' : self.config,
        }
        try:
            # Try IPython imports
            from IPython.frontend.terminal.interactiveshell import TerminalInteractiveShell
            from IPython.config.loader import Config

            cfg = Config()
            shell = TerminalInteractiveShell(config=cfg, user_ns=imported_objects)
            shell.mainloop(display_banner='\n  Samovar  \n')
        except:
            import code
            code.InteractiveConsole(locals=imported_objects).interact()
开发者ID:alefnula,项目名称:samovar,代码行数:17,代码来源:shell.py

示例3: debug

# 需要导入模块: from IPython.frontend.terminal.interactiveshell import TerminalInteractiveShell [as 别名]
# 或者: from IPython.frontend.terminal.interactiveshell.TerminalInteractiveShell import mainloop [as 别名]
def debug():
    from IPython.frontend.terminal.interactiveshell import TerminalInteractiveShell

    shell = TerminalInteractiveShell(user_ns=vars())
    shell.mainloop()
开发者ID:drewp,项目名称:blockstack,代码行数:7,代码来源:debug.py


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