Created
November 21, 2019 18:25
-
-
Save samredai/c9b6ca0b54cc10d9c6bdb714def31bc1 to your computer and use it in GitHub Desktop.
Python: Recursively list all subfolders and files in a directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
for root, dirs, files in os.walk(".", topdown=False): | |
for name in files: | |
print(os.path.join(root, name)) | |
for name in dirs: | |
print(os.path.join(root, name)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment