简体   繁体   English

如何在 jupyter 笔记本(VSCode + Python 扩展)中隐藏单元格 output?

[英]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.

相关问题 如何为 VSCode Jupyter 笔记本保存默认的 python env - How to save a default python env for VSCode Jupyter Notebooks Jupyter 笔记本不在 VS 代码 Python 扩展上运行 - Jupyter Notebooks not running on VS Code Python extension VSCODE JUPYTER - 如何在笔记本(.ipynb)中显示与 VSCode 的 python(.py)中相同的自动完成功能? - VSCODE JUPYTER - How to display SAME AUTOCOMPLETION in notebooks (.ipynb) as it is in python (.py) from VSCode? 如何在 Jupyter 笔记本中以编程方式生成 markdown output? - How to programmatically generate markdown output in Jupyter notebooks? 无法在 VScode 中打开 Python:Select 解释器或 Jupyter 笔记本 - Cannot open Python:Select Interpreter nor Jupyter notebooks in VScode 来自 Jupyter Notebooks 的 Python 版本和环境的 VSCode 问题 - VSCode issue with Python versions and environments from Jupyter Notebooks VSCode 中的 Jupyter 笔记本未显示最新的 Python 内核列表 - Jupyter notebooks in VSCode not showing up to date python kernel list Pylance 在 VSCode Jupyter 笔记本中不起作用 - Pylance not working in VSCode Jupyter notebooks 如何将 VSCode 上的向下箭头设置为 go 到 Jupyter Notebooks 的行尾? - How to make down arrow on VSCode to go to end of line in Jupyter Notebooks? 如何!rm python_var(在Jupyter笔记本中) - How to !rm python_var (in Jupyter notebooks)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM