JW
Size: a a a
JW
A
A
A
JW
A
def show_tree(path, file_ext):
for root, dirs, files in os.walk(path):
level = root.replace(".", "").count(os.sep)
indent = " " * 4 * (level)
print(f"{indent}{os.path.basename(root)}/")
subindent = " " * 4 * (level + 1)
for f in files:
if f.endswith(file_ext):
print(f"{subindent}{f}")
A
A
JW
A
A
DB
A
JW
if any((f.endswith(file_ext) for f in files)): ?DB
A
DB
glob.glob('**\*.py', recursive=True)JW
[f for f in files if f.endswith(file_ext)] а потом if not files: continueDB