使用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"

相关文章:

  • 2021-12-22
  • 2021-08-25
  • 2021-10-20
  • 2022-12-23
  • 2022-12-23
  • 2021-08-02
  • 2021-11-08
  • 2021-04-16
猜你喜欢
  • 2021-06-02
  • 2022-12-23
  • 2021-08-17
  • 2021-04-14
  • 2022-12-23
  • 2021-05-30
  • 2021-12-31
相关资源
相似解决方案