Py学习  »  Python

python-从文件夹中删除XLSX文件

scott martin • 6 年前 • 2098 次点击  

xlsx

path = '/users/user/folder'.  <-- Folder that has all the files
list_ = []
for file_ in path:
    fileList = glob.glob(path + "/*.xlsx")
    fileList1 = " ".join(str(x) for x in fileList)
        try:
            os.remove(fileList1)
        except Exception as e:
            print(e)

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/35469
文章 [ 3 ]  |  最新文章 6 年前