我是python的新手。我试图在我当前的脚本目录中解压缩文件,但我无法完成这项工作......
zip = zipfile.ZipFile(os.getcwd() + '/Sample_APE_File.zip')
zip.extractall(os.getcwd())
错误:AttributeError: 'str' object has no attribute 'getcwd'
答案 0 :(得分:3)
您为os
分配了一个字符串值,它不再绑定到模块:
os = 'some string'
将其重命名为其他内容。