Created
March 2, 2017 12:55
-
-
Save kerbrose/9df82abe98ead5c6324c105fabb725d5 to your computer and use it in GitHub Desktop.
this how to read all files with type in python 3
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
# reading all files with type xlsx | |
import os, fnmatch | |
rootdir = '~/' # your root path | |
for subdir, dirs, files in os.walk(rootdir): | |
for file in files: | |
if fnmatch.fnmatch(file, '*.xlsx'): | |
print(os.path.join(subdir, file)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment