gpt4 book ai didi

python - 无法使用 python 创建 ZIP 文件

转载 作者:太空宇宙 更新时间:2023-11-03 12:27:51 24 4
gpt4 key购买 nike

我正在尝试使用 python 3.4 创建 zipfile。执行后显示以下错误:

AttributeError: 'module' object has no attribute 'Zipfile'

我的代码:

import zipfile

f= zipfile.Zipfile("testZIP.zip","w")

最佳答案

它是 zipfile.ZipFile 大写 F 而不是 zipfile.Zipfile

关于python - 无法使用 python 创建 ZIP 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24713023/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com