213-boto3

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
import boto3
# 操作 S3 存储桶

s3 = boto3.client('s3')

# 列出存储桶
response = s3.list_buckets()

for bucket in response['Buckets']:
    print(bucket['Name'])