import os
import re
def check_flie(filePath
):
count
= 0
for file_path
, empty_list
, file_name_list
in os
.walk
(filePath
):
for file_name
in file_name_list
:
if re
.match
(r
'^data_*', file_name
):
os
.remove
(file_path
+ file_name
)
count
+= 1
if __name__
== '__main__':
filePath
= '/root/work_code/home/'
check_flie
(filePath
)
转载请注明原文地址: https://lol.8miu.com/read-13670.html