How to comment out Python code quickly?

Source: Internet
Author: User
In the python idle, add # in front of each line to make it easier to add a line when the comment is not running but the sentence is too many. Is there any quick way to add a line before multiple lines at a time # in the python idle, add # in front of each line to make it easier to add a line when the comment is not running but the sentence is too many. Is there any quick way to add a line before multiple lines at a time # reply content: use three single quotes to enclose the content to be annotated with the last three single quotes:

For example:
'''
Print hohohoho ~ Happy new year ~
''' If Eclipse + PyDev is used, select the code to be annotated and press and hold" Ctr + /"You can quickly comment out and press it again to cancel the comment. ""
"" Alt + 3, Alt + 4 Add comments, cancel comments you select the line to be commented on, and then press ctrl +/do you have any code to terminate the comments, similar to _ END __, tell the compiler that the following code is not used from here.
'''
'''
Vim block operations. Five seconds. On the vi or vim interface:

Single line comment. Add "#" at the beginning of the Code;
Multi-line comments. You can use three single or double quotation marks consecutively at the start and end positions. Vim can meet your requirements without any configuration.
Zhihu will not upload gif images. First paste an external link to pass Vim-through the graph bed.
The operations are as follows:
1. Ctrl + v, select the comment line
2. shift + I, entering the insert mode
3. Input #
4ESC exit insert mode
Multiline comment complete
Remove comments from multiple lines
1. Ctrl + v, select the comment line
2. x
Complete

I have time to introduce a very good vim annotation plug-in currently in use.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.