glob — Filename Pattern Matching — PyMOTW 3

Even though the glob API is small, the module packs a lot of power. It is useful in any situation where a program needs to look for a list of files on the file system with names matching a pattern. To create a list of filenames that all have a certain extension, prefix, or any common string in the middle, use glob instead of writing custom code to scan the directory contents.

Read more…

This post is part of the Python Module of the Week series for Python 3. See for more articles from the series.