gpt4 book ai didi

python - 向 python 模块添加帮助

转载 作者:行者123 更新时间:2023-12-01 04:50:14 24 4
gpt4 key购买 nike

我使用 Spyder,例如 numpy。然后,当我使用某些功能时,比如np.interp(),对象检查器为我提供有关此功能的帮助。如何将文档放入我的模块中,该模块将显示在 Spyder 的对象检查器中?

最佳答案

这将是 python 文档注释:

"""
This module contains methods and classes
"""

class class_:
"""
This class is well... a class
"""
def method(self, in_):
"""
This method takes one argument: in_ and returns it
"""
return in_

关于python - 向 python 模块添加帮助,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28627852/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com