Skip to content

Instantly share code, notes, and snippets.

@humanium
Created April 7, 2015 11:52
Show Gist options
  • Save humanium/670450ca54a246925bb2 to your computer and use it in GitHub Desktop.
Save humanium/670450ca54a246925bb2 to your computer and use it in GitHub Desktop.
Get all files paths in direstory recursively
def get_all_file_paths(root_path):
paths = []
for item in os.listdir(root_path):
full_path = os.path.join(root_path, item)
if os.path.isfile(full_path):
paths.append(full_path)
else:
paths.extend(get_all_file_paths(full_path))
return paths
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment