Reputation:
Hi when I comment out a line in Pycharm using the ctrl+slash keyboard shortcut, I get
# code
but instead I want
##Code
like in IDLE. Is this possible?
Upvotes: 1
Views: 4674
Reputation: 1020
You can register a new file type and at the time of registration specify comment characters. You need to reassign *.py to this new type from the default Python
file type that comes with installation.
Step by step procedure:
Ctrl+Alt+S
to open File Types dialogue.Alt+Insert
(or click on +
) to create a new file typeSyntax Highlighting
-> Line comment:
provide ##
OK
.Registered Patterns
section click +
to add a wildcard.Add wildcard
dialogue box enter *.py
and click Ok
Reassign wildcard
. Do so.Apply
and Ok
Note: We have to do all this because we can not edit default file types and Python
is a default file type.
Now, open a Python file (.py
extension) and check Ctrl+Slash
on any line. You should now see ##
prepended to the line.
Upvotes: 3