0, glob module and wildcards
The glob module has two main methods:
1 , the globe ()
2 iglob ()
Usually two or more points and the method used with wildcards, the wildcards used 3:
* : Matches zero or more characters
? :? Matches any single character # where the regular expression are different (? Regular expression matching front views 0 or 1))
[] : matching characters within the specified range, such as #: [1-9] Match 1 to 9 characters in
There are other two wildcards
** : Match all files, directories, subdirectories and files inside subdirectories (3 .5 version added)
[!] : Matches characters in the range are not specified
1, glob () method
glob () Returns the path of all files matching list (List); the process requires a parameter to specify the path string match (absolute path string may be a relative path).
Example:
Wildcard use supplemental example:
2, iglob () method
iglob () returns an iterator objects
Example:
3, and glob comparison list formula
note:
glob default file does not match the dot symbol (.) to start the
The current folder contains demo.txt and .demo.txt two files, sample