|| Python a powerful language, How to send automated message on whatsapp - Lesson 2 || Club5050||

in #learnwithsteem2 years ago (edited)

After writing on first lesson, I wondered should I go on writing usual stuff such as what are Strings or variables or just create an interest of the reader by writing a small program on our favorite platform which is WhatsApp, for sending a automated message on given time to the user mobile number.

Believe me it is very easy and you can achieve it by just writing a small lines of code and wallah, you are good to go.
So lets get started, first of all we may need to use installed IDE in order to get the output, however I will explain the concept on online platform and then you can just do it on it.

In order to run this program, you may need to install google chrome as its works well with it and I believe each and every computer now has chrome installed on there PC or laptop. You also need to let open your web whatsapp in order to run the program.

In order to do so you need to install a pip which is called pywhatkit. This can be easily done in offline software by writing below code on output server.

Pip install pywhatkit

Once it is installed you will get a confirmation from the console that it is 100% completed and installed.
Next step is to bring this library into your program, you can easy do so by below command.

Command: Import pywhatkit

import.jpg

What this command does is it called all the functions in this library contributed by different programmers and we can use them for whatever purpose we like.
Next step is to write our program.

Pywhatkit.sendwhatmsg(“+92387456258”, “How are you my love”, 17,30)

So lets understand what above line of code is saying to us, we called the function pywhatkit and ask it to send message by using function sendwhatmsg. Then we have opened the small brackets and ask the function to send the message on given number in inverted commas, after that we placed comma and write our message which we want to send.
Last but not the least we told the system on what time this message should be sent, in this case we asked it send on 5:30 PM. The whole program is as below.

whatsprogram.jpg

This program I Just wrote to let user interest develop in what python can do, however in next lessons I will write basics of the python as well as how to install different programs (IDE) so that new comer does not have any issue writing a program.

Coin Marketplace

STEEM 0.18
TRX 0.13
JST 0.029
BTC 57171.31
ETH 3134.47
USDT 1.00
SBD 2.26