簡體   English   中英

如何在 jupyter 筆記本(VSCode + Python 擴展)中隱藏單元格 output?

[英]How to hide cell output in jupyter notebooks (VSCode + Python Extension)?

我將 VSCode 1.38 版與 python 擴展 (ms-python.python) 結合使用,以便能夠在 VSCode 中修改 jupyter notebook。 是否有任何選項可以隱藏特定單元格的 output(例如,在一個單元格中繪制多個圖時)?

今天碰到同樣的問題。 似乎 jupyter notebook 的快捷方式已集成到 Visual Studio 代碼中的 jupyter notebook 中。 如果在單元格上按“o”,它將隱藏單元格 output。

將此作為單元格的第一行。

%%capture 
#Then the rest of your code in the cell...

來自該單元的 output 不會打印在筆記本電腦內。

似乎目前沒有選擇。
這里的官方文檔沒有提到這一點。
https://code.visualstudio.com/docs/python/jupyter-support

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM