Pastebin
Paste #24466: 123
< previous paste - next paste>
Pasted by 123
import boto3
# Set up connection to S3
s3 = boto3.client('s3')
# Set up S3 bucket and file names
bucket_name = 'my-s3-bucket'
file_name = 'data.csv'
# Download the file from S3
s3.download_file(bucket_name, file_name, 'data.csv')
# Open the file and process the data
with open('data.csv', 'r') as f:
data = f.read()
processed_data = process_data(data)
# Save the processed data back to S3
s3.upload_file('processed_data.csv', bucket_name, 'processed_data.csv')
New Paste
Go to most recent paste.