简体   繁体   English

如何在 Pycharm 中注释一行?

[英]How to comment a line in Pycharm?

What is the keyboard shortcut to comment text in Pycharm?在 Pycharm 中评论文本的键盘快捷键是什么?

When I use ctrl + / , I get:当我使用ctrl + /时,我得到:

pycharm截图

  1. Go to your PyCharm settings ( ctrl + alt + s ) and locate the Keymap on the left sidebar. Go 到您的 PyCharm 设置( ctrl + alt + s )并找到左侧边栏上的Keymap

  2. Look up comment using the search bar on the top right, and look at the shortcut for Comment with Line Comment .使用右上角的搜索栏查找comment ,并查看Comment with Line Comment的快捷方式。

  3. Change it to whatever you'd like, and see if it works.将其更改为您想要的任何内容,看看它是否有效。

Ref. 参考。

line comment is行注释是

#comment here

multiple line comment is多行注释是

/* comment
   here
*/

It is collapsing and expanding code block.它正在折叠和扩展代码块。 Try // for single-line comments Or /* For multiple line comments */尝试 // 单行注释或 /* 多行注释 */

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

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