本文整理汇总了Python中IPython.frontend.terminal.embed.InteractiveShellEmbed.stdin_encoding方法的典型用法代码示例。如果您正苦于以下问题:Python InteractiveShellEmbed.stdin_encoding方法的具体用法?Python InteractiveShellEmbed.stdin_encoding怎么用?Python InteractiveShellEmbed.stdin_encoding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPython.frontend.terminal.embed.InteractiveShellEmbed
的用法示例。
在下文中一共展示了InteractiveShellEmbed.stdin_encoding方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: patched_init_io
# 需要导入模块: from IPython.frontend.terminal.embed import InteractiveShellEmbed [as 别名]
# 或者: from IPython.frontend.terminal.embed.InteractiveShellEmbed import stdin_encoding [as 别名]
def patched_init_io(self):
io.stdout = io.IOStream(sys.stdout)
io.stderr = io.IOStream(sys.stderr)
InteractiveShell.init_io = patched_init_io
banner2 = """Warning:
Spyder does not support GUI interactions with IPython >=v0.11
on Windows platforms (only IPython v0.10 is fully supported).
"""
__ipythonshell__ = InteractiveShellEmbed(banner2=banner2)#,
# display_banner=False)
# __ipythonshell__.shell.show_banner()
# __ipythonshell__.enable_pylab(gui='qt')
#TODO: parse command line options using the two lines commented
# above (banner has to be shown afterwards)
#FIXME: Windows platforms: pylab/GUI loop support is not working
__ipythonshell__.stdin_encoding = os.environ['SPYDER_ENCODING']
del banner2
except ImportError:
# IPython v0.10
import IPython.Shell
__ipythonshell__ = IPython.Shell.start()
__ipythonshell__.IP.stdin_encoding = os.environ['SPYDER_ENCODING']
__ipythonshell__.IP.autoindent = 0
# Workaround #2 to make the HDF5 I/O variable explorer plugin work:
# we import h5py only after initializing IPython in order to avoid
# a premature import of IPython *and* to enable the h5py/IPython
# completer (which wouldn't be enabled if we used the same approach
# as workaround #1)
# (see sitecustomize.py for the Workaround #1)
try: