是否可以在 iPython 笔记本中仅查看 "out" 个单元格?

Is it possible to view only "out" cells in iPython Notebook?

有时我不需要代码,只想查看 iPython 中的报告。是否可以在 iPython 笔记本中仅查看 "out" 个单元格?

是的。安装 ipython-notebook-extensions。这些扩展程序提供了许多功能,包括 runtools,它允许您

Hide or show input (i.e. the source code) of marked code cells

Hide or show output of marked code cells

如果您使用的是 ipython3.x,则可以通过以下方式从 ipython 笔记本安装:

import IPython.html.nbextensions as nb
ext= 'https://github.com/ipython-contrib/IPython-notebook-extensions/archive/3.x.zip'
nb.install_nbextension(ext)

加载 runtools 扩展程序

from IPython.html.services.config import ConfigManager
ip = get_ipython()
cm = ConfigManager(parent=ip, profile_dir=ip.profile_dir.location)
cm.update('notebook', {"load_extensions": {"IPython-notebook-extensions-3.x/usability/runtools/main": True}})

从一个普通的笔记本,下面, 您可以标记一个单元格(或所有单元格)并且 查看或隐藏输入和输出。