Skip to content

Instantly share code, notes, and snippets.

@slv922
Created February 23, 2018 08:42
Show Gist options
  • Save slv922/61549eb559a702e6c747d37ec8c92163 to your computer and use it in GitHub Desktop.
Save slv922/61549eb559a702e6c747d37ec8c92163 to your computer and use it in GitHub Desktop.
recursively get a list of all the files in a directory
#!/usr/bin/python
import glob
import os
import sys
SRC = sys.argv[1]
for root, directories, filenames in os.walk(SRC):
for directory in directories:
print os.path.join(root, directory)
for filename in filenames:
print os.path.join(root,filename)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment