19from os
import path, walk
22 print(
"Please provide the directory where documented .py files are.")
27(_, _, filenames) = next(walk(pyz_dir))
30for pyz_file
in filenames:
31 if not pyz_file.endswith(
'.py'):
34 pyz_file_path = pyz_dir + path.sep + pyz_file
35 with open(pyz_file_path)
as fd:
36 file_contents = fd.read()
39 module = ast.parse(file_contents)
40 ds = ast.get_docstring(module)
42 with open(pyz_file_path +
'.pyzdoc',
'w')
as pyz_doc_file:
43 pyz_doc_file.write(ds)