On Desktop ur script. On Desktop my folder (script inside). I wrote the paths correctly.
Running the script and it's freezes. I manually closing it. Inside of the new zip file two folders "." and "..", where first is empty and second with the whole my Desktop.
What's wrong?
I don't really know much about this (and I don't know Python either), but I ask Claude same thing and it said error on line 55, and also it rewrote whole zipper part.
Here the new code:
with zipfile.ZipFile(ZIPPATH, "w", zipfile.ZIP_DEFLATED) as zip:
src = os.path.abspath(SOURCEPATH)
for (root, dirs, files) in os.walk(src, topdown=True):
for f in files:
full_path = os.path.join(root, f)
# Store path relative to SOURCEPATH, so the zip has clean internal structure
arcname = os.path.relpath(full_path, src)
zip.write(full_path, arcname)
zip.close()
I hope it helps, because It definitely helped me!