'How to do block-comments in Google Colab on a Mac with a non-American keyboard?
I want to do block-comments in Colab using a Mac laptop (Big Sur), so I had a look here:
Is it possible to do block-comments in Google Colab?
Ctrl+/ does not work for me, so I follow jakevdp's advice:
If this does not work for you, check Tools->Keyboard Shortcuts and search for "Comment Current Line" to see what the shortcut is within your current settings.
Here's the output:
This leads to several problems:
- The shortcut I need is one of the very few that can't be customized.
- On my non-American keyboard, I need to press Shift+
7
, to get/
- On the Mac, ⌘ + Shift +
7
is bound to the Help menu: How to use the macOS Help menu
To summarize, every time I try to comment a block of code, the Help menu opens instead. Is there any workaround for this?
PS: I tried all the other answers to Is it possible to do block-comments in Google Colab?, and they didn't work.
Solution 1:[1]
I found a simple solution. If the standard solution ? + Shift + 7 doesn't work for you (like it didn't for me)....just use the / from the numeric keypad!
? + numeric keypad 7 worked great for me.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Peter Mortensen |