繁体   English   中英

如何在 Visual Studio Code 中为每个 python 单元格边界显示一行?

[英]How to display a line for every python cell boundary in Visual Studio Code?

在 VS Code 中,当使用 python 文件时,如果我们输入#%%它会创建一个单元格分隔。 当 cursor 位于单元格内时,编辑器会为上边界显示一条粗线,为下边界显示一条细线(仅限当前单元格)。 如何更改样式以便始终为每个单元格边界显示一条线(例如在 Spyder 编辑器中)?

编辑:我找到了这些设置,但它们仅适用于交互式 window 而不是编辑器:

    "workbench.colorCustomizations": {
        "notebook.cellBorderColor": "#ff0000",
        "notebook.cellToolbarSeparator": "#00ff00"
    }

我期待找到一种在下面的红色箭头处显示线条的方法: 缺少 Python 单元格分隔线

我已经看到显示这些线条的屏幕截图,但我找不到如何。

编辑 2:有没有办法自定义每个插入的行的样式/外观,显示可点击的命令Run Cell | Run Above | Debug Cell Run Cell | Run Above | Debug Cell Run Cell | Run Above | Debug Cell

Jupyter对您来说是一个不错的选择,它具有单独的代码单元。

从命令面板创建 jupyter notebook 然后安装所需的模块ipykernal ,您可以在其中运行 python 代码单元。 参考: VS Code 中的 Jupyter Notebook。

看看这个: extension-visualstudio

也许我们需要检查 [vscode-python] ( https://github.com/microsoft/vscode-python ): package.nls.json 存储了很多 dicts,但我找不到 Run Cell | 跑到上面| 调试单元也是..

作为一种可能的技巧,您可以扩展单元格命令。 其设置称为“Jupyter:Code Lenses”。 我将我的设置为:“jupyter.runcell,jupyter.runallcellsabove,jupyter.debugcell,jupyter.runcell,jupyter.runcell,jupyter.runcell,jupyter.runcell,jupyter.runcell,jupyter.runcell,jupyter.runcell,jupyter.runcell, jupyter.runcell、jupyter.runcell、jupyter.runcell、jupyter.runcell、jupyter.runcell、jupyter.runcell、jupyter.runcell"

模拟单元格边界的长单元格命令列表

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM