CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
adasegroup

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: adasegroup/NEUROML2022
Path: blob/main/seminar4/utils.py
Views: 63
1
import os
2
3
def list_files(startpath):
4
for root, dirs, files in os.walk(startpath):
5
level = root.replace(startpath, '').count(os.sep)
6
indent = ' ' * 4 * (level)
7
print('{}{}/'.format(indent, os.path.basename(root)))
8
subindent = ' ' * 4 * (level + 1)
9
for f in files:
10
print('{}{}'.format(subindent, f))
11