Skip to content

Instantly share code, notes, and snippets.

@ptrin
Created January 23, 2013 16:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ptrin/4609708 to your computer and use it in GitHub Desktop.
Save ptrin/4609708 to your computer and use it in GitHub Desktop.
def get_file_list(dir=options.source_dir):
""" Returns list of all html files in specified directory (recursive) """
fileList = []
print dir
try:
for root, subFolders, files in os.walk(dir):
for file in files:
filepath = os.path.join(root,file)
if ".html" in filepath:
fileList.append(filepath)
print fileList
return fileList
except OSError as e:
print e.errno
print e.filename
print e.strerror
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment