Created
October 30, 2020 08:56
-
-
Save mburakerman/41a8af6e9f6f9292b9bf433eae97d721 to your computer and use it in GitHub Desktop.
find a specific file using python
This file contains 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 | |
import fnmatch | |
rootPath = '/' | |
pattern = '*.mp3' | |
for root, dirs, files in os.walk(rootPath): | |
for filename in fnmatch.filter(files, pattern): | |
print(os.path.join(root, filename)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment