综述
python遍历文件夹
代码
import os
from os.path import isfile, join
pathIn = "im1"
files = [f for f in os.listdir(pathIn) if isfile(join(pathIn, f))]
print(files)
python遍历文件夹
import os
from os.path import isfile, join
pathIn = "im1"
files = [f for f in os.listdir(pathIn) if isfile(join(pathIn, f))]
print(files)