Reputation: 73
Is there any shortcut in the IntelliJ IDE such as PyCharm to comment all the lines start with 'print'
?
Since during the debug I always write many prints, after the code runs well I want to find a convenient way to comment on all lines starting with 'print'
. Now I select each line/block
with command + /
which is trouble.
Upvotes: 2
Views: 1275
Reputation: 182
Why not just:
Find: print(
Replace: #print(
And, to get back:
Find: #print(
Replace: print(
This worked pretty well for me. I don't find the reason for using complex regex for this.
Upvotes: 0
Reputation: 1106
Not sure about pycharm, but I guess you could use find/replace with a regex like '^print'
and substitute with '# print'
. Maybe you can even make this a macro / Hotkey in pycharm.
Upvotes: 1