Glob module
The glob module is a Python standard-library module for finding filesystem pathnames that match shell-style wildcard patterns.
Python Workout, Second Edition
glob is a Python standard-library module for finding pathnames that match shell-style wildcard patterns.
- How it is used
- Selects files by shell-style pathname patterns when processing a directory’s matching files.
- How deep it goes
- Explains glob.glob usage and contrasts it with os.listdir and pathlib, without detailing wildcard semantics beyond * and ?.
- Examples
- Uses /etc/*.conf for configuration files and scores/*.json for selecting class score files.
- What you can do after
- Apply it via glob.glob to gather matching pathnames for subsequent file processing.
Read how Python Workout, Second Edition explains glob module →
Python Workout: 50 ten-minute exercises
glob is a Python standard-library module for finding filesystem pathnames that match shell-style wildcard patterns.
- How it is used
- Finds selected filesystem pathnames for subsequent file processing.
- How deep it goes
- Defines wildcard matching and demonstrates iteration, but defers detailed pattern syntax and implementation internals.
- Examples
- Uses scores/*.json and /etc/*.conf to select matching files.
- What you can do after
- Apply it via Python's glob.glob function to iterate over files matching a pathname pattern.
Read how Python Workout: 50 ten-minute exercises explains glob module →
The Quick Python Book, Fourth Edition
The glob module is a Python standard-library module that finds filesystem pathnames matching shell-style wildcard patterns.
- How it is used
- Finds filesystem pathnames matching shell-style wildcard patterns.
- How deep it goes
- Defines three wildcard forms and demonstrates their outputs, but does not discuss more complex matching requirements.
- Examples
- Demonstrates *, *json, ?.tmp, and [0-9].tmp against sample directory contents.
- What you can do after
- Apply it via glob.glob to collect filesystem names matching reusable wildcard patterns.
Read how The Quick Python Book, Fourth Edition explains glob module →
Related concepts
- os.listdiralternative to · os.listdir is a Python standard-library function that returns the names of entries in a specified filesystem directory.
- Dir#entriesalternative to · Dir#entries is a Ruby method that returns the entries of a directory as an array.
- pathlibused by · pathlib is a Python standard-library module providing object-oriented classes and operations for representing and manipulating filesystem paths.
- DirectoryLoaderused by · DirectoryLoader is a LangChain document-loading component that discovers files in a directory and delegates format-specific extraction to an underlying loader.
- FileSensorused by · FileSensor is an Airflow sensor that checks whether a file exists at a specified path.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


