Last active
March 6, 2024 12:09
-
-
Save BedirYilmaz/f8932b0554d5e00ead5bb58b9247304a to your computer and use it in GitHub Desktop.
listing files with a specific extension in a directory with glob
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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