Back
How can I see what's inside a bucket in S3 with boto3? (i.e. do an "ls")?
Doing the following:
import boto3s3 = boto3.resource('s3')my_bucket = s3.Bucket('some/path/')
import boto3
s3 = boto3.resource('s3')
my_bucket = s3.Bucket('some/path/')
returns:
s3.Bucket(name='some/path/')
How do I see its contents?
One way to do it:
for my_bucket_object in my_bucket.objects.all(): print(my_bucket_object)
for my_bucket_object in my_bucket.objects.all():
print(my_bucket_object)
Learn how we helped 50,000+ professionals like you !
31k questions
32.8k answers
501 comments
693 users