summaryrefslogtreecommitdiff
path: root/Chap16ProjTextMyself.py
blob: ac67ca94b14bbb2112ab7c87e6892409cc10de7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#! python3

# Chapter 16 Project Just Text Me Module
# Defines the textmyself() function that texts a message passed to it
# as a string.

from twilio.rest import TwilioRestClient

accountSID = 'ACxxxxxxxxxxxxxxxxxxxx'
authToken = 'xxxxxxxxxxxxxxxxxxxxxxx'
myNumber = '+15558675309'
twilioNumber = '+15558675309'

def textmyself(message):
    twilioCli = TwilioRestClient(accountSID, authToken)
    twilioCli.messages.create(body=message, from_=twilioNumber, to=myNumber)