import os filepaths = []; dirpaths = []; pathName = r'C:\anfei\json\20191128' for root, dirs, files in os.walk(pathName): for file in files: file_path ...
import os
filepaths = [];
dirpaths = [];
pathName = r'C:\anfei\json\20191128'
for root, dirs, files in os.walk(pathName):
for file in files:
file_path = os.path.join(root, file)
filepaths.append(file_path)
for dir in dirs:
dir_path = os.path.join(root, dir)
dirpaths.append(dir_path)
print(filepaths)
print(dirpaths)