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 后,即可直接多行结果输出。

猜你喜欢

转载自www.cnblogs.com/ly123456/p/12372618.html