1# python 3
2import os
3
4for dirpath, dirnames, filenames in os.walk(dir_path):
5 print(dirpath)
6 print(dirnames)
7 print(filenames)
8
9# python 2
10import os.path
11
12def print_it(x, dir_name, files):
13 print(dir_name)
14 print(files)
15
16os.path.walk(your_dir, print_it, 0)