Hi and welcome to a new section on sending Smith with Python in the next video, we be writing the actual
Python script, which sends an SMS to your mobile phone from another mobile phone.
In this video, we will set up an account.
Now what is this account?
Well, to send assignments with Python.
Unfortunately, it's not free.
You have to use some third party services, but fortunately, there are services which give you some
free credits, which you can use to send SMS.
And then every SMS that you sends is being taken out from.
That's created.
It's about $0.01 or something like that, depending on where in the world you are sending SMS, and
that's third party services to you.
So you should go to 2U dot com and then sign up for an account filling those data.
You should get an email that you need to go to that email and confirm it.
And then.
After you confirm it, you should be able to go to the page, visits Troy later, maybe go to the homepage.
Yeah.
So clever.
And the next page is again a verification you need to enter your phone number here.
So that's a condition that needs to be satisfied to be able to create an account and be able to send
some as my python through Twilio.
So fill in your number here and you'll get an SMS with a confirmation code.
And once you verify your phone number using the code that will be essential, then you should fill in
these data here.
So we want to use the eSIM as products of Twilio.
They have different products as well, which can be used in relation with Python.
Let's say for alerts and notifications, it doesn't matter what you choose, they're out shoes with
codes here.
So we are using Twilio through Python.
The preferred language is, of course, Python.
And would you like to host your coding team?
Yes.
And click on Get Started with Twilio.
Then on this page.
You have some details, such as you have the account balance of fifteen point five dollars I have.
And if you want more, you need to upgrade and pay.
Of course, we have the account I.D. here, which we will use to connect with Python and also the authentication
token in here.
And you want to go to get trial phone number to get a number from which you're going to send estimates
from.
This will be my number.
It's an American number.
Choose this number and the number should be created for you.
So that's the phone number.
If you press on Don, you should also see the phone number down here in the main page.
So in develop, this is my number.
The next what we want to do is you want to go to the Read Quickstart doc.
That should open these documentation.
And you want to go down to Python.
And let's now configure our environment to work with three new.
So on Ripple, I will create a new report with Python and say, send asthma's, create a ripple, and
let's see now what we have to do.
So click on that button to start.
You can sign up for a free trial accounts here.
We did that already so we can press on.
I've got an account.
What's next?
Yeah, so we have three operating systems here.
The one I will be using is Linux because Apple is based on Linux, so we are basically in a Linux operating
system in here.
So we have to run this command so selected and copy it or just press this button here.
Click to copy.
Go to Ripple and go to Shell.
Not to the console.
Go to shell and paste that.
So that commands East to install, not to yes, then we have some other commands here, but first,
you want to go to this link and we have these commands that we need to run.
So that's installed.
No dodging us, but we need to configure it with these commands.
So go to Raffel.
Make sure this has finished.
It's finished in my case and paste that other commands execute.
Yeah, nothing happens.
That's OK.
Go back to here.
That's all we have to do on this page.
Close that this is again, our Tullio guide.
You want to copy that commands the first one.
Go to Ripple Paste.
It's.
Executes successful go again to the guides.
Get the other commands, but be careful here.
You don't want to paste this thing, so you want to do envy and use envy em use of then the version,
so envy em use the version in my case is that this one in here you see v sixteen point thirteen point
zero, so you should write your own version as well.
That was installed with the previous commands.
So v sixteen points, thirteen point zero and executes.
Yeah, we got this message.
That's notes version sixteen point thirteen is being used now.
Everything is going well up to this point, then you want to install this package on Linux now on the
Ripple.
The command is slightly different.
You shouldn't do sudo apt.
Get install both.
You can do it.
Install Dash P K G.
A space and then this package.
Copy that.
Pasted there, so that's a complete comment executes.
Have insulation went fine.
So I'll go back to the guides.
And lastly, we want to install to you your command line.
So copy that codes.
We're on it again.
Yeah, successful.
And lastly, this command should update the latest version of Twilio.
So wrong, that's also.
Done next.
Yeah, so it seems wrong to illegal logging, but that's not necessary in our case, so we can skip
that because we were using Python to login.
And yeah, also this one, if you don't currently own a tool, your phone number, we already got a
phone number from the web interface, so you can skip that too.
And then we need to install Python.
Python is already installed on a reptile, so no need for that either.
But we need to install Twilio, so just go to rappel to the packages menu and search for to you with
you.
That's one click the plus icon, and my package was told to India racist thoughts next.
So we stood with the triple package manager so you can keep these commands.
And lastly, we are ready to sense an.
And that is the codes.
This one here.
So just copy it.
Go to revel in your main profile piece that's called.
Right.
There are a few things we need to change here, so we import OS and then we import the Kleins class
from Twilio, and then we need to change the account I.D. to reflect our accounts.
The way this is working is through environment variables.
So these should be an environment variable registered in our report.
Therefore, you need to copy that key and go to secrets and paste.
That's key here.
So we are creating a key with a value and the value should be your account I.D..
So here on Twilio, my account, this idea is this one here so I can copy that.
Go to Ripple and create this value.
Press on adds new secrets you'll see up here that this has been added.
Now we also need to create another key, which is this tullio of token, the authentication token.
The key is that the value is again on the websites here under the account as I.D. D, that was the account.
This idea, this is a token.
So you want to copy that and paste it in here and press on at new secrets.
And now we should have those two registered in our environment, Linux environments.
Next, we created this Kline's instance, using those to call this idea and authentication token variables.
And the message is this one so body of the message this one in here from now, this should be your Twilio
number, the number you got from Twilio, which in my case, is this one in here.
So phone number, the US phone number you want to paste, it's in here.
And then to this is a number you wants to send an SMS to now, as far as I know, for free to Twilio
accounts as we have now, you should use your own number, the number that you use to verify your to
your account.
Otherwise, the SMS will not go through.
So use your own number here.
So I entered my number here and now I can run this script.
And I hope you heard the ring that my eSIMs is already here in the summers that I received.
I can see that this body of the message is there, and Twingo is also adding some other texts because
we are using a trial plan.
So that's fair, and that's how you can send an SMS via Python.
I'll talk to you later.