February 2006
Intermediate to advanced
648 pages
14h 53m
English
The glob module returns all filenames in a directory that match a pattern specified using the rules of the UNIX shell (as described in the fnmatch module).
glob(pattern)
Returns a list of pathnames that match pattern.
glob('*.html')
glob('image[0-5]*.gif')
Note
Tilde (~) and shell variable expansion are not performed. Use os.path.expanduser() and os.path.expandvars(), respectively, to perform these expansions prior to calling glob().