【发布时间】:2016-11-09 12:09:32
【问题描述】:
我有一个 ZIP 文件,我需要提取文件名中包含字符串“test”的所有文件(通常是一个)。都是xlsx文件。
我为此使用 Python zipfile。这是我的代码不起作用:
zip.extract(r'*\test.*\.xlsx$', './')
我得到的错误:
KeyError: "There is no item named '*\\\\test.*\\\\.xlsx$' in the archive"
有什么想法吗?
【问题讨论】: