1import os
2folder_path = r'C:\Test'
3for root,dirs,files in os.walk(folder_path, topdown=True):
4 print(root)
5 print(dirs)
6 print(files)
1# !/usr/bin/python
2
3import os
4for root, dirs, files in os.walk(".", topdown=False):
5 for name in files:
6 print(os.path.join(root, name))
7 for name in dirs:
8 print(os.path.join(root, name))