Hi, in this video, you learn how to send an SMS at a particular time every day.
We did already writes that this codes in the previous video, so you have to watch the previous video
in order to understand this one.
So in this section, we have a while loop.
Down here, which periodically executes this, killed every 60 seconds.
Now what are we going to do is we are going to register to recall the current time with details.
Now what is the T.?
Well, that is a class from the datetime library.
So from date time, import date, time s d t, so is that one?
And no, it's a method that gives us the current date and time, which looks like this.
Let me try it quickly here in the interactive shell.
And now will be the current date time.
Then once we have the current date time, we can check.
For example, if the clock at this moment is 13 18, so 1:00 pm 18 minutes, then we're going to execute
this code, so we hear the message and send it out.
And also, this should be indented under the if conditional and the time that sleep method as well,
both time that sleep.
Should stay here.
So what's happening here is that we get the current date time.
We check if that's current daytime is this.
So the time when we want to send the SMS.
And if it is, then we send out of the SMS.
We print out this message that the SMS will send out.
And then what we do is we wait 60 seconds.
And then we execute the, if conditional, one more time.
So basically after every minute, we check the time we check if the current daytime reaches our timestamp
of interest and the loop goes on.
So that's a complete code.
I thank you for calling and lets you in the next few.