python删除目录下文件大小小于某个值的方法

        for file in os.listdir('yolov3_tiny_car_det/output'):
            fsize = os.path.getsize(f'yolov3_tiny_car_det/output/{file}')
            if (fsize<40000):
                os.remove(f'yolov3_tiny_car_det/output/{file}')
yolov3_tiny_car_det/output为目录,40000指字节
原文地址:https://www.cnblogs.com/ywheunji/p/12256668.html