Python multiline comment not working

I was coding in a level, and I needed to comment out multiple lines. So I added the usual python comment ‘’’, and I get an error for this and the code gets run still. Also “”" won’t work
Example:
’’‘
self.say(“Hi”)
’’’

Is there a way in the game to comment out multiple lines in python?

Select the lines you want to comment, then press Ctrl+/ (or Ctrl+; depending on your keyboard layout/locale) on Windows/Linux, or Cmd+/ on OS X.

The same works for uncommenting.

2 Likes

Pressing Ctrl+; didn’t bring the result I was hoping for (picture). I use Nordic key layout, so Ctrl+/ is a browser shortcut, while Ctrl+Alt+0 (meaning ‘}’ ) makes an editor shortcut to collapse functions and not the bracket.
While trying different key combinations, I found that Ctrl+’ comments each line selected. So there is a workaround for this. Thanks!

Oh, nice. :smile:
The documentation says the shortcut is Ctrl+/, but due to the way the Ace editor handles shortcuts, the key that produces the expected keycode actually varies depending on the keyboard layout. For instance, on a PT-BR ABNT2 keyboard it is the semi-colon.