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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM