Created
November 24, 2017 22:52
-
-
Save glauesppen/071c584baf17ad85e621a17a0b4562bc to your computer and use it in GitHub Desktop.
A path is passed and the function returns all directories and files in the tree.
This file contains 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 | |
def list_dir(parent): | |
dir = os.listdir(parent) | |
for lists in dir: | |
directory = os.path.join(parent, lists) | |
print directory | |
if os.path.isdir(directory): | |
list_dir(directory) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment