多行输出
Notebook的中开头cell中添加以下代码可以实现多行输出:
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = 'all'
#默认为'last'
想一劳永逸的设置,那么可以去C:\Users\ThinkPad.ipython\profile_default目录创建ipython_config.py文件
将下面的文字复制保存,重启Notebook后即可生效。
c = get_config()
c.InteractiveShell.ast_node_interactivity = "all"
网友评论