Shortcut key for commenting out lines of Python code in Spyder

Kurt Peek picture Kurt Peek · Apr 15, 2016 · Viewed 209.3k times · Source

I recently changed from the Enthought Canopy Python distribution to Anaconda, which includes the Spyder IDE.

In Canopy's code editor, it was possible to comment and uncomment lines of code by pressing the "Cntrl+/" shortcut key sequence. In Spyder I was unable to find an equivalent shortcut key in the introductory tutorial.

Is there a shortcut key for commenting and uncommenting code in Spyder?

Answer

Suresh2692 picture Suresh2692 · Apr 15, 2016
  • Single line comment

    Ctrl + 1

  • Multi-line comment select the lines to be commented

    Ctrl + 4

  • Unblock Multi-line comment

    Ctrl + 5