-2
我有一個ZIP文件,我需要提取包含字符串「test」在文件名中的所有文件(通常是一個)。他們都是xlsx文件。使用Python zip文件從ZIP壓縮包含特定字符串的文件
我正在使用Python zipfile。這是我的代碼不能正常工作:
zip.extract(r'*\test.*\.xlsx$', './')
的錯誤,我得到:
KeyError: "There is no item named '*\\\\test.*\\\\.xlsx$' in the archive"
任何想法?