import os
allfiles = list()
# listing all the files in the subdirectories
root = "yourDirectory/"
path = os.path.join(root, "targetdirectory")
for path, subdirs, files in os.walk(root):
for name in files:
s = os.path.join(path, name)
allfiles.append(str(s))
for l in allfiles:
print l
No comments:
Post a Comment