Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keyboard shortcut to comment code in Thonny IDE

Tags:

python

thonny

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

like image 876
B45i Avatar asked Oct 29 '25 15:10

B45i


2 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.

like image 168
Nehal Shaikh Avatar answered Nov 01 '25 04:11

Nehal Shaikh


Use Ctrl+3 for toggling between "commented" and "uncommented".

Use Alt+3 to comment. Use Alt+4 to uncommment.

(Screenshot)

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

like image 39
Giantfire33 Avatar answered Nov 01 '25 05:11

Giantfire33