1 回答

TA貢獻1816條經(jīng)驗 獲得超4個贊
如果要列出每個 blob 的文件大小。有一個很直接的方法:
# Create the BlobServiceClient that is used to call the Blob service for the storage account
conn_str = ' '
blob_service_client = BlobServiceClient.from_connection_string(conn_str=conn_str)
container_name = ' '
# List the blobs's information in the container
print("\nList blobs in the container")
container = blob_service_client.get_container_client(container=container_name)
generator = container.list_blobs()
for blob in generator:
print("\t Blob name: " + blob.name)
print("\t Blob size: "+ str(blob.size))
它以我的方式工作。
如果要列出 blob 的所有信息,只需執(zhí)行print(blob)
.
添加回答
舉報