首页 > 编程语言 > 详细

【Python学习】Jupyter解决单个变量输出问题

时间:2018-09-29 13:38:28      阅读:258      评论:0      收藏:0      [点我收藏+]

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

【Python学习】Jupyter解决单个变量输出问题

原文:https://www.cnblogs.com/IvyWong/p/9723073.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!