Return a List of Files and Folders With Glob in Python
There’s a great library added in Python 3.5 that lets you return a list of filenames and folders called glob, here’s how to use it. Return files and folders in current folder. >>> glob('**') ['scaffolds', 'node_modules', 'yarn.lock', '_config.yml', 'source', 'db.json', 'themes', 'package.json', 'package-lock.json'] Return files and folders recursively >>> glob('**', recursive=True) ['scaffolds', 'scaffolds/post.md', 'scaffolds/page.md', 'scaffolds/draft.md', 'node_modules', '...'] Return only specific type of files recursively >>> glob('*.json', recursive=True) ['db.json', 'package.json', 'package-lock.json'] non-recursively >>> glob('**/*....