How to batch comment and cancel Python code Select the code and hold down Ctrl+/ to comment the selected line. Press Ctrl+/ again and the comment is removed.