import os
import zipfile

src = r'C:\Users\86156\.qclaw\workspace\temp_skill'
dst = r'D:\wxpic\wechat-mp-publisher-latest.zip'

with zipfile.ZipFile(dst, 'w', zipfile.ZIP_DEFLATED) as zf:
    for root, dirs, files in os.walk(src):
        # 跳过 __pycache__
        dirs[:] = [d for d in dirs if d != '__pycache__']
        for f in files:
            if f.endswith('.pyc'):
                continue
            full = os.path.join(root, f)
            arcname = os.path.relpath(full, os.path.dirname(src))
            zf.write(full, arcname)
            print(f'Added: {arcname}')

print(f'Created: {dst}')
print(f'Size: {os.path.getsize(dst) / 1024:.1f} KB')
