Shortcut key for commenting out lines of Python code in Spyder
I recently changed from the Enthought Canopy Python distribution to Anaconda, which includes the Spyder IDE.
In Canopy's code editor, it was possible to comment and uncomment lines of code by pressing the "Cntrl+/" shortcut key sequence. In Spyder I was unable to find an equivalent shortcut key in the introductory tutorial.
Is there a shortcut key for commenting and uncommenting code in Spyder?
Solution 1:
-
Single line comment
Ctrl + 1
-
Multi-line comment select the lines to be commented
Ctrl + 4
-
Unblock Multi-line comment
Ctrl + 5
Solution 2:
On macOS:
Cmd + 1
On Windows, probably
Ctrl + (/) near right shift key