# -*- coding:utf-8 -*- from suds.client import Client import zipfile import base64 #访问并读取接口内容,用标准64位解码器解码 url = "http://地址:端口/JmYfjzService/clientBasicService?WSDL" clent=Client(url) data=base64.standard_b64decode(clent.service.downNewBzk(3205830101L,'32058301012018050215',0.0)) #创建一个zip文件,关闭保存 f=zipfile.ZipFile('a.zip','w') f.close() #打开这个zip文件,并将data保存到这个文件中 f=open('2.1result.zip','wb',buffering=1) f.write(data) f.close() #解压缩 exampleZip = zipfile.ZipFile('a.zip') exampleZip.extractall() exampleZip.close()