Python——Jupyter notebook如何输出多行结果

先执行:

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

永久更改方法:

在修改默认目录时,cmd执行: jupyter notebook --generate-config 时,生成的文件夹 .ipython 中,

进入路径:C:\Users\Administrator\.ipython\profile_default ,新建文件:ipython_config.py

输入内容:

c = get_config()
c.InteractiveShell.ast_node_interactivity = "all"
保存,关闭文件。

重启 Jupyter notebook 后,即可直接多行结果输出。

posted @ 2020-02-27 16:02  linux_zero  阅读(3192)  评论(0编辑  收藏  举报