• Home
  • Raw
  • Download

Lines Matching +full:is +full:- +full:glob

1 :mod:`glob` --- Unix style pathname pattern expansion
4 .. module:: glob
7 **Source code:** :source:`Lib/glob.py`
11 --------------
14 single: * (asterisk); in glob-style wildcards
15 single: ? (question mark); in glob-style wildcards
16 single: [] (square brackets); in glob-style wildcards
17 single: ! (exclamation); in glob-style wildcards
18 single: - (minus); in glob-style wildcards
19 single: . (dot); in glob-style wildcards
21 The :mod:`glob` module finds all the pathnames matching a specified pattern
23 arbitrary order. No tilde expansion is done, but ``*``, ``?``, and character
24 ranges expressed with ``[]`` will be correctly matched. This is done by using
30 unlike :func:`fnmatch.fnmatch` or :func:`pathlib.Path.glob`.
34 For a literal match, wrap the meta-characters in brackets.
39 The :mod:`pathlib` module offers high-level path objects.
42 .. function:: glob(pathname, *, root_dir=None, dir_fd=None, recursive=False, \
47 (like :file:`/usr/src/Python-1.5/Makefile`) or relative (like
48 :file:`../../Tools/\*/\*.gif`), and can contain shell-style wildcards. Broken
51 conditions is removed or added during the call of this function, whether
52 a path name for that file be included is unspecified.
54 If *root_dir* is not ``None``, it should be a :term:`path-like object`
56 :func:`glob` as changing the current directory before calling it. If
57 *pathname* is relative, the result will contain paths relative to
64 single: **; in glob-style wildcards
66 If *recursive* is true, the pattern "``**``" will match any files and zero or
68 pattern is followed by an :data:`os.sep` or :data:`os.altsep` then files will not
71 If *include_hidden* is true, "``**``" pattern will match hidden directories.
73 .. audit-event:: glob.glob pathname,recursive glob.glob
74 .. audit-event:: glob.glob/2 pathname,recursive,root_dir,dir_fd glob.glob
93 Return an :term:`iterator` which yields the same values as :func:`glob`
96 .. audit-event:: glob.glob pathname,recursive glob.iglob
97 .. audit-event:: glob.glob/2 pathname,recursive,root_dir,dir_fd glob.iglob
112 This is useful if you want to match an arbitrary literal string that may
122 which contains only the file :file:`3.txt`. :func:`glob` will produce
126 >>> import glob
127 >>> glob.glob('./[0-9].*')
129 >>> glob.glob('*.gif')
131 >>> glob.glob('?.gif')
133 >>> glob.glob('**/*.txt', recursive=True)
135 >>> glob.glob('./**/', recursive=True)
142 >>> import glob
143 >>> glob.glob('*.gif')
145 >>> glob.glob('.c*')
151 Shell-style filename (not path) expansion