You can use method of creating object instance to upload the file from your local machine to AWS S3 bucket in Python using boto3 library.
Here is the code I used for doing this:
import boto3
s3 = boto3.resource('s3')
s3.create_bucket(Bucket= 'anikets3bucket')
s3.Object('anikets3bucket','abcd.txt').upload_file(Filename='C:\\Users\\Aniket\\Desktop\\abcd.txt')
Hope it helps!
If you need to know more about Python, It's recommended to join Python course today.
Thanks!