AttributeError: obiekt 'module' nie ma atrybutu 'ZipFile'
tak jak powiedziałem, to bardzo dziwne pytanie. Mam nadzieję, że dzięki wam pomogliście mi rozwiązać to pytanie
Oto mój kod:
import os
import zipfile
filename = "E:\\test.zip"
currdir = "E:\\vpn\\"
os.chdir(currdir)
tfile = zipfile.ZipFile(filename, 'w')
files = os.listdir(currdir)
for f in files:
tfile.write(f)
for f in tfile.namelist():
print "added %s"%f
tfile.close()
komunikat o błędzie:
Traceback (most recent call last):
File "C:\pydemo\src\gzip\zipfile.py", line 7, in <module>
import zipfile
File "C:\pydemo\src\gzip\zipfile.py", line 14, in <module>
tfile = zipfile.ZipFile.(filename, 'w')
AttributeError: 'module' object has no attribute 'ZipFile'