python send text message

Solutions on MaxInterview for python send text message by the best coders in the world

showing results for - "python send text message"
Jonah
31 Jan 2019
1# Download the helper library from https://www.twilio.com/docs/python/install
2import os
3from twilio.rest import Client
4
5
6# Find your Account SID and Auth Token at twilio.com/console
7# and set the environment variables. See http://twil.io/secure
8account_sid = os.environ['TWILIO_ACCOUNT_SID']
9auth_token = os.environ['TWILIO_AUTH_TOKEN']
10client = Client(account_sid, auth_token)
11
12message = client.messages \
13    .create(
14         body='This is the ship that made the Kessel Run in fourteen parsecs?',
15         from_='+15017122661',
16         to='+15558675310'
17     )
18
19print(message.sid)