如何在Jupyter中显示完整输出,不仅仅是最后的结果? [英] How to display full output in Jupyter, not only last result?
本文介绍了如何在Jupyter中显示完整输出,不仅仅是最后的结果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望Jupyter能够打印所有的交互式输出而不需要打印,而不仅仅是最后的结果。怎么做?
I want Jupyter to print all the interactive output without resorting to print, not only the last result. How to do it?
示例:
a=3
a
a+1
我想显示
3
4
3
4
推荐答案
感谢Thomas,这里是我正在寻找的解决方案:
Thanks to Thomas, here is the solution I was looking for:
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
这篇关于如何在Jupyter中显示完整输出,不仅仅是最后的结果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文