Skip to content

Instantly share code, notes, and snippets.

@kerbrose
Created March 2, 2017 12:55
Show Gist options
  • Save kerbrose/9df82abe98ead5c6324c105fabb725d5 to your computer and use it in GitHub Desktop.
Save kerbrose/9df82abe98ead5c6324c105fabb725d5 to your computer and use it in GitHub Desktop.
this how to read all files with type in python 3
# 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