Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I block comment code in an IPython notebook with a German keyboard?

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.

like image 837
SmCaterpillar Avatar asked Oct 22 '14 09:10

SmCaterpillar


People also ask

How do you comment on a German keyboard in python?

The "Code" -> "Comment with Line Comment" shortcut is Ctrl+Slash, which is Ctrl+Shift+7.

How do you block comments in a Jupyter notebook?

All you need to do, is select all the lines you want to comment and press Ctrl + / as shown in below video.

How do you comment out a whole section in a Jupyter notebook?

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.

How do I use Ipython block of code?

Alt + Enter or Esc + Enter execute the current code block, regardless of cursor position.


1 Answers

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 the Alt button pull down your mouse until the last line you want to comment. Finally, you can release the Alt button and then use the # character to comment.

like image 192
Robotnik Avatar answered Nov 28 '22 03:11

Robotnik