How can I block comment a selected text in an IPython Notebook with a German keyboard layout? Ctrl-/ does not work, which on a German keyboard actually is Ctrl-Shift-7.
The "Code" -> "Comment with Line Comment" shortcut is Ctrl+Slash, which is Ctrl+Shift+7.
All you need to do, is select all the lines you want to comment and press Ctrl + / as shown in below video.
To comment out a block of code – First, we need to select all those lines which we want to comment out. Next, on a Windows computer, we need to press the ctrl + / key combination to comment out the highlighted portion of the code.
Alt + Enter or Esc + Enter execute the current code block, regardless of cursor position.
I found this great workaround for international keyboard layouts from Dataman in How do I comment out multiple lines in Jupyter Ipython notebook?
Press the
Alt
button and keep holding it. The cursor should change its shape into a big plus sign. The next step is, using your mouse, to point to the beginning of the first line you want to comment and while holding theAlt
button pull down your mouse until the last line you want to comment. Finally, you can release theAlt
button and then use the#
character to comment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With