在iPython(Jupyter)笔记本中滚动窗口以获取代码? [英] Scroll windows for code in iPython (Jupyter) Notebooks?
问题描述
有没有办法在滚动窗口中显示iPython笔记本中的大块代码?
Is there a way to display large blocks of code in an iPython notebook in a scroll window?
我有一个笔记本,其重点是图形输出降价文本中的代码和注释。我希望能够在笔记本中执行代码并将其提供给读者,但许多代码块都非常冗长。滚动窗口可以使笔记本更清晰,更简洁,允许读者选择移动大型代码块。
I have a notebook where the focus is on graphical output of the code and comments in the markdown text. I want to be able to execute the code in the notebook and have it available to the reader, but many of the code blocks are very lengthy. A scroll window would make a notebook much cleaner and more concise, allowing readers the option of moving past large code blocks.
推荐答案
目前为止最好的方法是使用 hide_code
包( https://pypi.python.org/pypi/hide_code/0.1.5 )。要安装:
The best way so far is to use the hide_code
package (https://pypi.python.org/pypi/hide_code/0.1.5). To install:
$ pip install hide_code
这将使您能够隐藏或显示每个单元格的内容。
太棒了!
This will enable you to hide or display the content of each individual cell. It is great !
虽然我希望输入单元格的垂直滚动条很快就可用。
Though I hope the vertical scroll bar for input cells will be available soon.
这篇关于在iPython(Jupyter)笔记本中滚动窗口以获取代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!