glob (Intermediate/Misc Python 1)

glob.glob

  • glob.glob(pattern)
    • find all files matching pattern
      • glob.glob("*.py")
      • glob.glob("data*.csv")
    • pattern can contain a path containing folder names
      • windows: glob.glob("files\\*.py")
      • mac/linux: glob.glob("files/*.py")
      • find all python files in the folder files