简体   繁体   中英

How do you add function guides to python when writing a module?

I was recently writing a python module with many functions, and I was wondering if it was possible, and if so, how can I implement these function guides as shown in the picture below. Thanks in advance!

在此处输入图片说明

These are function docstring s, to define them when writing a function, simply add a multi-line string to the start of the function

def function():
    '''This function does nothing'''
    pass

To access the docstring, use function.__doc__ or help(function)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM