10.2. 文件通配符

glob 模块提供了一个在目录中使用通配符搜索创建文件列表的函数:

  1. >>> import glob
  2. >>> glob.glob('*.py')
  3. ['primes.py', 'random.py', 'quote.py']