使用module, class, method 的 docstring. help会自动识别这些docstring。
比如:
#!/usr/bin/env python2
# coding=utf-8
"""This is module help.
"""
class C1(object):
"""class's help string.
"""
def __init__(self, a):
"""method's help string.
"""
pass
def f1():
"""this is f1's help string.
"""
pass
然后你可以import这个模块之后,使用 help(f1) 等查看docstring.