Skip to content

Instantly share code, notes, and snippets.

@Dmitrii-I
Last active August 29, 2015 14:21
Show Gist options
  • Save Dmitrii-I/afad915ac2e0fd9b1a10 to your computer and use it in GitHub Desktop.
Save Dmitrii-I/afad915ac2e0fd9b1a10 to your computer and use it in GitHub Desktop.
def list_files_recursively(topdir):
files = []
topdir = os.path.expanduser(topdir)
for dirname, dirnames, filenames in os.walk(topdir):
for filename in filenames:
fullpath = os.path.join(dirname, filename)
files.append(fullpath[len(topdir)+1:])
return files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment