Jupyter 解决单个变量输出问题

使用Jupyter的时候有时候发现,我明明写了好几个变量打印,但是它只显示最后一个。Out只有一个。

但是使用下面的语句。就可以实现多个输出。

from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all" 

而如果要为Jupyter所有实例设置这个的话,那么可以在路径~/.ipython/profile_default/下创建ipython_config.py文件。

代码如下

c = get_config()

# Run all nodes interactively
c.InteractiveShell.ast_node_interactivity = "all"
原文地址:https://www.cnblogs.com/IvyWong/p/9723073.html