问题
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.
回答1:
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.
来源:https://stackoverflow.com/questions/35537789/scroll-windows-for-code-in-ipython-jupyter-notebooks