Skip to content

Instantly share code, notes, and snippets.

@jeangjenq
Last active March 20, 2022 07:38
Show Gist options
  • Save jeangjenq/6c7f8e780483d47e3ee611b3db69ff23 to your computer and use it in GitHub Desktop.
Save jeangjenq/6c7f8e780483d47e3ee611b3db69ff23 to your computer and use it in GitHub Desktop.
List all directory, subdirectory and files
l = []
for root, directories, filenames in os.walk('./'):
for directory in directories:
l.append(os.path.join(root, directory))
for filename in filenames:
l.append(os.path.join(root, filename))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment