【发布时间】:2021-06-04 16:36:19
【问题描述】:
运行以下代码
with open('abc', 'wt') as fh:
fh.write('\n'.join(['a','b','c']))
在ipython 中,没有预期的输出;
但是,在jupyter 笔记本中,输出类似于[Out 4]: 5。
可能与
有关from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
在 jupyter 中。但是jupyter输出有什么奇怪的东西,如何预防呢?
【问题讨论】:
标签: python jupyter-notebook output jupyter