Answers for "boto3 python package"

2

python boto3

#to install
pip install boto3
# example codes

import boto3

# Let's use Amazon S3
s3 = boto3.resource('s3')

# Print out bucket names
for bucket in s3.buckets.all():
    print(bucket.name)
    
# Upload a new file
data = open('test.jpg', 'rb')
s3.Bucket('my-bucket').put_object(Key='test.jpg', Body=data)
Posted by: Guest on May-31-2021

Python Answers by Framework

Browse Popular Code Answers by Language