Send SMS via Python

As you continue to read these post you’ll realize that all of these scripts will end up into one BIG project. For this script, its for sending sms to yourself or others. In the project in question it’ll send an sms if someone were to log into my site or near my homemade camera or trying to log into my computers. Here is the code snippet:

#Twillo send sms
import os
from twilio.rest import Client

account_sid = os.environ['Key here']
auth_token = os.environ['os environment']
client = Client(account_sid, auth_token)

message = client.messages \
                .create(
                     body="Join Earth's mightiest heroes. Like Kevin Bacon.",
                     from_='your twilio number',
                     to='your phone number'
                 )

print(message.sid)