Python实现删除路径下的所有文件

# coding: utf-8

import os

root_path1 = 'F:\\template\\hand-obj-data-pick Tool\\HandData\\depthMap\\depthGrayMap'

files1 = os.listdir(root_path1)
for listfile1 in files1:
    filepath1 = os.path.join(root_path1,listfile1)
    os.remove(filepath1)

猜你喜欢

转载自blog.csdn.net/Blackrosetian/article/details/81230753