python del files simple

# Author:Alex
# Date:2017.06.05
# Version:3.6.0
#!/usr/bin/python
# del all files
import os
dir = '/opt/download_file'
os.chdir(dir)
file = os.listdir(dir)
for del_file in file:
print (os.remove(del_file))
print ('----------- all dir_file')
posted @ 2017-06-05 11:12  Alex_Footprint  阅读(285)  评论(0编辑  收藏  举报