有没有人知道如何在 python 中使用多处理从 Azure 存储下载 Blob?
下面的代码给了我这个错误:“ TypeError: 'Blob' object is not iterable ”
如何解决?
代码:
def downloadBlobs(generator):
for Blob in generator:
path = 'temp/' + Blob.name.split('/')[-1]
block_service.get_blob_to_path(CONTAINER_NAME,Blob.name,path)
if __name__ == '__main__':
start = timeit.default_timer()
generator = block_service.list_blobs(CONTAINER_NAME, prefix='trt2', num_results=1000)
p = Pool()
p.map(downloadBlobs, generator)
final = timeit.default_timer() - start
print(final)