📜 ⬆️ ⬇️

A simple script for sending SMS

I keep learning Python. The language is beautiful, I am glad that when my colleague is a non-programmer, he gets behind my code and he can read and understand it. There was a task to make SMS notification to customers (well, about the delay, new services, etc.). We bought a GSM Teleofis modem. To work with him, prog programs were made, they didn’t really find them, and free and all the more. I had to open the manuals and write a simple prog under Windows, which opens the COM port on which the modem sits and writes AT commands to it.

The script itself requires pySerial to work under Windows.

To run the script, you need to plug a modem into the computer, install firewood, open the sms_sender.py file and edit line 90 there:
')
a = Sender(( '790864x0807' ,),u " , « » . , [ 91 ]." ,1,115200,2)

* This source code was highlighted with Source Code Highlighter .

The first parameter is the destination tuple, the second is the message text. The third is the port number. The rest we do not need - this is the speed and timeout waiting for a response.
And then make a command call from the command line
python sms_sender.py

You will see:
more PDU to go ...
more PDU to go ...


This script sends parts of your message to recipients. That's all.
The script itself is available by reference. There are no restrictions on its use, it is very simple and small to somehow limit its use.

Source: https://habr.com/ru/post/67810/


All Articles