🔵 🔵 🔵


Primary

၊၊||၊|။

glob ⚬⃕ᵖʸ|Documentation|1st|20251021000106-00-⌔

glob — Unix style pathname pattern expansion — Python 3 documentation

glob — Unix style pathname pattern expansion

Source code: Lib/glob.py

The glob module finds pathnames using pattern matching rules similar to the Unix shell. No tilde expansion is done, but , ?, and character ranges expressed with [] will be correctly matched. This is done by using the os.scandir() and fnmatch.fnmatch() functions in concert, and not by actually invoking a subshell.

Note: The pathnames are returned in no particular order. If you need a specific order, sort the results.

Files beginning with a dot (.) can only be matched by patterns that also start with a dot, unlike fnmatch.fnmatch() or pathlib.Path.glob(). For tilde and shell variable expansion, use os.path.expanduser() and os.path.expandvars().

For a literal match, wrap the meta-characters in brackets. For example, '[?]' matches the character '?'.

The glob module defines the following functions:

Printed 2026-06-28.

(echo:: @ )

Link to original

Secondary

• • •