MCPcopy Create free account
hub / github.com/0xPolygon/polygon-docs-old / list_files

Function list_files

scripts/toc-script.py:16–25  ·  view source on GitHub ↗
(startpath)

Source from the content-addressed store, hash-verified

14import os
15
16def list_files(startpath):
17 for root, dirs, files in sorted(os.walk(startpath)):
18 level = root.replace(startpath, '').count(os.sep)
19 indent = ' ' * 4 * (level)
20 print(' {}- {}:'.format(indent, os.path.basename(root).capitalize()),)
21 subindent = ' ' * 4 * (level + 1)
22 for f in sorted(files):
23 title = str(f).replace('.md', '')
24 filepath = os.path.join(root, f)
25 print(' {}- {}: {}'.format(subindent, title, filepath))
26
27list_files("zkEVM")

Callers 1

toc-script.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected