jupyter-如何注释掉单元格? [英] jupyter - how to comment out cells?

查看:586
本文介绍了jupyter-如何注释掉单元格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能在jupyter中注释掉整个细胞?

Is it possible to comment out whole cells in jupyter?

在这种情况下,我需要它:

I need it for this case:

我有很多单元,除了少数几个,我想全部运行.我喜欢将我的代码组织在不同的单元格中,但是我不想转到每个单元格并注释掉其行.我宁愿以某种方式选择我要注释掉的单元格,然后一次性注释掉它们(这样以后我就可以轻松地取消注释它们了)

I have a lot of cells, and I want to run all of them, except for a few of them. I like it that my code is organized in different cells, but I don't want to go to each cell and comment out its lines. I prefer to somehow choose the cells I want to comment out, then comment them out in one go (so I could later easily uncomment them)

谢谢

推荐答案

标记单元格的内容,然后按 Ctrl + /.它将注释掉该单元格中的所有行.重复相同的步骤以取消注释单元格的行.

Mark the content of the cell and press Ctrl+ /. It will comment out all lines in that cell. Repeat the same steps to uncomment the lines of your cell.

这篇关于jupyter-如何注释掉单元格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆