Skip to content

Instantly share code, notes, and snippets.

@BedirYilmaz
Last active March 6, 2024 12:09
Show Gist options
  • Save BedirYilmaz/f8932b0554d5e00ead5bb58b9247304a to your computer and use it in GitHub Desktop.
Save BedirYilmaz/f8932b0554d5e00ead5bb58b9247304a to your computer and use it in GitHub Desktop.
listing files with a specific extension in a directory with glob
import os
from glob import glob
path = "path/to/files"
ext = "*.file_extension"
list(glob(os.path.join(path, ext)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment