When using the AWS CLI it references the credentials and config files located in the ~/.aws directory. And you use the --profile flag to indicate which account you want. Such as:
aws ec2 describe-instances --profile=company-lab
aws ec2 describe-instances --profile=company-nonprod
etc.
But I am new to scripting in python 3 and boto 3 and want to do the same thing there. How can I switch between AWS accounts using python?