Using Python to Send SMS Text Messages

I recently created a hardware project using a Raspberry Pi and needed it to send SMS text messages to my mobile phone. I wanted to do this using a Python script which I was using to control various sensors and other bits of electronics. I didn't want the hassle of connecting the system to a mobile phone so I decided to send the text messages via the internet.

In the past you could send SMS messages for free using various weird and wonderful websites. These services were either illegal or relied on defects in the phone networks. The only reliable way of sending SMS messages is to use a legit paid-for web service. This costs to send each message but is usually pennies per message.

I looked at various options and decided to use TxtLocal. You can sign-up for a free account and they give you 10 fee text messages to start you off.