python中如何获取函数文档
1、
>>> def a(x,y):
"""
function: sum
author: xxxx
date: 2021:03:08
"""
print(x + y)
>>> a(10,8)
18
>>> print(a.__doc__) ## 获取函数文档
function: sum
author: xxxx
date: 2021:03:08
>>> help(a) ## 获取帮助
Help on function a in module __main__:
a(x, y)
function: sum
author: xxxx
date: 2021:03:08