[英]How to hide cell output in jupyter notebooks (VSCode + Python Extension)?
I use version 1.38 of VSCode in combination with the python extension (ms-python.python) to be able to modify jupyter notebooks inside of VSCode.我将 VSCode 1.38 版与 python 扩展 (ms-python.python) 结合使用,以便能够在 VSCode 中修改 jupyter notebook。 Is there any option to hide the output of specific cells (eg when plotting multiple plots in one cell)?是否有任何选项可以隐藏特定单元格的 output(例如,在一个单元格中绘制多个图时)?
Bumped into the same problem today.今天碰到同样的问题。 It seems to be that the shortcuts from jupyter notebook are integrated into the jupyter notebook in visual studio code.似乎 jupyter notebook 的快捷方式已集成到 Visual Studio 代码中的 jupyter notebook 中。 If you press "o" on a cell, it will hide the cell output.如果在单元格上按“o”,它将隐藏单元格 output。
Put this as the first line of your cell.将此作为单元格的第一行。
%%capture
#Then the rest of your code in the cell...
The output from that cell won't be printed inside the notebook.来自该单元的 output 不会打印在笔记本电脑内。
Seems like there's no option for that at the moment.似乎目前没有选择。
The official document here doesn't mention that.这里的官方文档没有提到这一点。
https://code.visualstudio.com/docs/python/jupyter-support https://code.visualstudio.com/docs/python/jupyter-support
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.