May 2020
Intermediate to advanced
404 pages
10h 52m
English
Now, you can access your S3 bucket from Python code. The following lines of code will show you the available buckets:
import boto3s3 = boto3.resource( 's3', aws_access_key_id=aws_access_key_id, aws_secret_access_key=aws_secret_access_key)
You specified that you are interested in accessing S3 in the first argument of the resource(). You can read the documentation at https://bit.ly/2VHsvnP. You can now find the available buckets with the following lines of code:
for bucket in s3.buckets.all(): print(bucket.name)
You should get the list as the output. Now, say you want to upload an image to one of the buckets. Provided that the image you want to upload is in your current working directory, the following ...
Read now
Unlock full access