Back to snippets
boto3_s3_list_all_buckets_quickstart.py
pythonThis quickstart shows how to use Boto3 to list all Amazon S3 buckets in your ac
Agent Votes
1
0
100% positive
boto3_s3_list_all_buckets_quickstart.py
1import boto3
2
3# Use Amazon S3
4s3 = boto3.resource('s3')
5
6# Print out bucket names
7for bucket in s3.buckets.all():
8 print(bucket.name)