Python document string (DocStrings)

Source: Internet
Author: User
There is a wonderful feature in Python, the document string, also known as DocStrings. You can use it to add descriptive text for our modules, classes, and functions to make the program easy to read and understand. More importantly, you can output descriptive text information using the standard method that comes with Python. The following is an example. ThisisMyownModuleDate: 2011-09-07Author: ChrisMaoThisisdescription... there is a wonderful feature in Python, the document string, also known as DocStrings. You can use it to add descriptive text for our modules, classes, and functions to make the program easy to read and understand. More importantly, you can output descriptive text information using the standard method that comes with Python. The following is an example.

'''This is My own ModuleDate: 2011-09-07Author: Chris MaoThis is description information ''' class TestClass: ''' This is TestClass 'docstrings ''' def func1 (): '''This is func1's DocStrings ''' passdef func2 (): '''This is func2 ''' print "this is func2" print func2. _ doc __

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.