generate_docs.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:tockloader 作者: helena-project 项目源码 文件源码
def generatedocs(module, filename):
    try:
        sys.path.insert(0, os.getcwd() + '/..')
        # Attempt import
        mod = pydoc.safeimport(module)
        if mod is None:
           print("Module not found")

        # Module imported correctly, let's create the docs
        with open(filename, 'w') as f:
            f.write(getmarkdown(mod))
    except pydoc.ErrorDuringImport as e:
        print("Error while trying to import " + module)

# if __name__ == '__main__':
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号