码迷,mamicode.com
首页 > 编程语言 > 详细

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

时间:2018-09-29 14:32:12      阅读:414      评论:0      收藏:0      [点我收藏+]

标签:active   file   shel   activity   strong   学习   jupyter   class   code   

使用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解决单个变量输出问题

标签:active   file   shel   activity   strong   学习   jupyter   class   code   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!