import os
my_list = os.listdir('My_directory')
import os
subfolders = [ f.path for f in os.scandir(folder) if f.is_dir() ]
for path, subdirs, files in os.walk(root):
for name in files:
print os.path.join(path, name)
os.walk(directory)
[x[0] for x in os.walk(directory)]