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__':
评论列表
文章目录