如下是遍历文件夹, 读取每一个文件, topdown是遍历方式,work是当前代码目录的文件夹名称
for root, dirs, files in os.walk("work", topdown=False):
for name in files:
file = os.path.join(root, name)
logger.info(file)
with codecs.open(file, 'r', 'gbk') as f:
f_csv = csv.reader(f)
网友评论