I\'m trying to write a simple Python script that will copy a index.tpl to index.html in all of the subdirectories (with a few exceptions).
I\'m getting bogged down
import pathlib def list_dir(dir): path = pathlib.Path(dir) dir = [] try: for item in path.iterdir(): if item.is_dir(): dir.append(item) return dir except FileNotFoundError: print('Invalid directory')