PyDocs

Nav

File and Directory Access

iglob

glob

function (source)
  • iglob(pathname, *, root_dir=None, dir_fd=None, recursive=False, include_hidden=False)
Return an iterator which yields the paths matching a `pathname` pattern.

The pattern may contain simple shell-style wildcards a la
fnmatch. However, unlike fnmatch, filenames starting with a
dot are special cases that are not matched by '*' and '?'
patterns.

The order of the returned paths is undefined. Sort them if you need a
particular order.

If `root_dir` is not None, it should be a path-like object specifying
the root directory for searching.  It has the same effect as changing
the current directory before calling it (without actually changing it).
If pathname is relative, the result will contain paths relative to
`root_dir`.

If `dir_fd` is not None, it should be a file descriptor referring to a
directory, and paths will then be relative to that directory.

If `include_hidden` is true, wildcards can match path segments beginning
with a dot ('.').

If `recursive` is true, the pattern '**' will match any files and
zero or more directories and subdirectories.
Changed in 3.5, 3.10, 3.11
  • 3.5: Support for recursive globs using “**”.
  • 3.10: Added the root_dir and dir_fd parameters.
  • 3.11: Added the include_hidden parameter.
0 Examples
No examples for glob/iglob.
See Also
No see-alsos for glob/iglob
0 Notes
No notes for iglob