I want to comment out a block of multiple lines in Jupyter (Ipython Notebook), but can't find out how to do that in this current version.
It used to be in one of the drop down menus but is no longer there.
How do you comment out multi-line blocks of code at once?
This is not a duplicate because the solution given in the following link doesn't seem to work anymore:
How can I block comment code in the IPython notebook?
Ctrl + / does nothing.
Fn + Cmd + / in Safari browser on MacOS
Try using the
/
from the numeric keyboard.Ctrl
+/
in Chrome wasn't working for me, but when I used the/
from the numeric it worked.I add the same situation and went in a couple of stackoverfow, github and tutorials showing complex solutions. Nothing simple though! Some with "Hold the alt key and move the mouse while the cursor shows a cross" which is not for laptop users (at least for me), some others with configuration files...
I found it after a good sleep night. My environment is laptop, ubuntu and Jupyter/Ipython 5.1.0 :
Just select/highlight one line, a block or something, and then "Ctrl"+"/" and it's magic :)
I am using chrome, Linux Mint; and for commenting and dis-commenting bundle of lines:
For a Dutch keyboard layout (on Debian 9 in Chromium 57) it is Ctrl + °
Use triple single quotes
'''
at the beginning and end. It will be ignored as adoc string
within the function.I can't figure out how to print that in multiple lines but you can add a line anywhere in between those quotes and your code will be fine.