本文整理汇总了Python中IPython.frontend.terminal.interactiveshell.TerminalInteractiveShell.autocall方法的典型用法代码示例。如果您正苦于以下问题:Python TerminalInteractiveShell.autocall方法的具体用法?Python TerminalInteractiveShell.autocall怎么用?Python TerminalInteractiveShell.autocall使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPython.frontend.terminal.interactiveshell.TerminalInteractiveShell
的用法示例。
在下文中一共展示了TerminalInteractiveShell.autocall方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: interactive
# 需要导入模块: from IPython.frontend.terminal.interactiveshell import TerminalInteractiveShell [as 别名]
# 或者: from IPython.frontend.terminal.interactiveshell.TerminalInteractiveShell import autocall [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)