Return a list of paths matching a pathname pattern. The pattern may contain simple shell-style wildcards a la fnmatch. Unlike fnmatch, filenames starting with a dot are special cases that are not matched by '*' and '?' patterns by default. If `include_hidden` is true, th
(pathname, *, root_dir=None, dir_fd=None, recursive=False,
include_hidden=False)
| 11 | __all__ = ["glob", "iglob", "escape"] |
| 12 | |
| 13 | def glob(pathname, *, root_dir=None, dir_fd=None, recursive=False, |
| 14 | include_hidden=False): |
| 15 | """Return a list of paths matching a pathname pattern. |
| 16 | |
| 17 | The pattern may contain simple shell-style wildcards a la |
| 18 | fnmatch. Unlike fnmatch, filenames starting with a |
| 19 | dot are special cases that are not matched by '*' and '?' |
| 20 | patterns by default. |
| 21 | |
| 22 | If `include_hidden` is true, the patterns '*', '?', '**' will match hidden |
| 23 | directories. |
| 24 | |
| 25 | If `recursive` is true, the pattern '**' will match any files and |
| 26 | zero or more directories and subdirectories. |
| 27 | """ |
| 28 | return list(iglob(pathname, root_dir=root_dir, dir_fd=dir_fd, recursive=recursive, |
| 29 | include_hidden=include_hidden)) |
| 30 | |
| 31 | def iglob(pathname, *, root_dir=None, dir_fd=None, recursive=False, |
| 32 | include_hidden=False): |