Why "Comment with block comment" is always disabled in Pycharm 1.5.4

I found that in the Code | Comment "Comment with a block comment" is always disabled.

How to fix it?

+11
pycharm
source share
6 answers

Because in python there is no such thing as a block comment.

""" stuff here """ is for documentation purposes.

+11
source share

Although it is true that Python does not have block comments, I recently switched from Aptana Studio and had a nice comment format in the block, which contained spaces / idents, allowing you to uncomment the lock and the supported packaging, which was neat.

 ############################### # a = b # code_block = commented_out ############################### 

I think you can’t have everything!

+2
source share

Code | A comment with a block comment remains gray if pycharm does not know the syntax for adding comments to a specific file type. You can configure this in File | Settings, then select "Editor / File Type". Select the type of recognized file for which you want to configure comments, or add it if it does not exist.

+2
source share

Some IDEs (Wingware, PyCharm) allow you to select a range of lines, and then ttype # character (Wingware), select ctrl - / (PyCharm), or another method. This comments on each line, putting # in front of the first non-white character on each line.

+1
source share

Ctrl + / (un) comments on all selected lines. Agree, this is not intuitive, but it works

+1
source share

As a rule, in pycharm for commenting the code we use the Hash symbol ( # ), keyboard shortcuts;

  • For one line comment we use ctrl + /, in order to uncomment it again.

  • For multi-line comments, we select these lines, and then use ctrl + /, to uncomment this again, keeping these lines.

    Hooray!

0
source share

All Articles