python中常用的便捷巧妙的方法
1.获取某个目录下面所有匹配的文件list
from glob import glob files = glob("../checkpoints_path/*.json") files out: ['../checkpoints_path\\copy-task-1-batch-1000.json', '../checkpoints_path\\copy-task-1-batch-1500.json', '../checkpoints_path\\copy-task-1-batch-2000.json', '../checkpoints_path\\copy-task-1-batch-2500.json', '../checkpoints_path\\copy-task-1-batch-3000.json', '../checkpoints_path\\copy-task-1-batch-500.json']

浙公网安备 33010602011771号