读取字节码格式的zip文件
import zipfile
import io
local_file_path = "test.zip"
new_zip = io.BytesIO()
fp = zipfile.ZipFile(new_zip, 'w', zipfile.ZIP_DEFLATED, False)
with zipfile.ZipFile(local_file_path, mode='r') as f:
for name in f.filelist:
print("name: ", name)
fp.writestr(name, f.open(name).read())
fp.close()
print(new_zip.getvalue())