Whats is the keyboard short cut to comment single line of code and slsected lines of code in Thony IDE for python? Ie, The Thony equivalent of ctrl + / in VS Code
5 Answers
To comment single line: Put a cursor on the line which you want to comment. Press Alt+3 to comment, Alt+4 to un-comment.
To comment single line: Select the desired lines of code to comment. Follow same keys i.e. press Alt+3 to comment, Alt+4 to un-comment.
Note: For further shortcuts, please click on Edit menu option next to File and you'd see various shortcuts available in Thonny IDE.

- 21
- 2
-
Murtaza Haji can you please check? – Nehal Shaikh Mar 30 '21 at 05:44
-
You have two " To comment single line" entries. I assume you meant " To comment multiple lines" – MSIS Dec 07 '21 at 21:18
Single line comment.Ctrl + 1
.
Multi-line comment select the lines to be commented. Ctrl + 4
.
Unblock Multi-line comment. Ctrl + 5
.

- 92
- 8
Use Ctrl+3
for toggling between "commented" and "uncommented".
Use Alt+3
to comment.
Use Alt+4
to uncommment.
If you want to change the default shortcuts, you can follow the instructions on this official github-page: https://github.com/thonny/thonny/wiki/Custom-shortcuts

- 11
- 3
With the latest update of Thonny IDE you can do
ctrl + 3
for both single line and multiline commenting and uncommenting.

- 11
- 2
On Mac and the most recent version of Thonny,
command+3
3 being the key with the # hash key above it. Works on single line and multi-select.

- 7,380
- 5
- 41
- 51