I am trying the below to upload a file to s3. I a, using python 2.7.
import boto3
from botocore.exceptions import NoCredentialsError
ACCESS_KEY = 'xxxxxxxxxxxxxx'
SECRET_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
def upload_to_aws(local_file, bucket, s3_file):s3 = boto3.client('s3', aws_access_key_id=ACCESS_KEY,aws_secret_access_key=SECRET_KEY)
#try:s3.upload_file(local_file, bucket, s3_file)
upload_to_aws('C:\Users\test_2_fields.csv', 'test-bukcet-aws', '/tmpload/test_2_fields.csv')
I am running into syntax error. can you please suggest what's wrong
import boto3
from botocore.exceptions import NoCredentialsError
ACCESS_KEY = 'xxxxxxxxxxxxxx'
SECRET_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
def upload_to_aws(local_file, bucket, s3_file):s3 = boto3.client('s3', aws_access_key_id=ACCESS_KEY,aws_secret_access_key=SECRET_KEY)
#try:s3.upload_file(local_file, bucket, s3_file)
upload_to_aws('C:\Users\test_2_fields.csv', 'test-bukcet-aws', '/tmpload/test_2_fields.csv')
I am running into syntax error. can you please suggest what's wrong
Larz60+ write Nov-25-2020, 11:44 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Also please fix indentation errors.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Also please fix indentation errors.