Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
30 lines (22 sloc) 768 Bytes
#!/usr/bin/env python
* A Twilio account
* Python with the twilio library (`pip install twilio`)
* A purchased phone number on twilio to serve as your "from" number ($1/mo)
* Some twilio credits to pay for the $.01/msg SMS fees
The python-twilio library uses OS-level environment variables
to store SID/Token info:
from os import environ
from import TwilioRestClient
def send_text(body, recipient):
sms_sender = environ['TWILIO_PHONE_NUMBER']
client = TwilioRestClient()
message = client.sms.messages.create(
to = recipient,
from_ = sms_sender,
body = body)
return message
Something went wrong with that request. Please try again.