Automate WhatsApp messages using python in 2 lines of code
Hello everyone, in this video we are going to make a WhatsApp automation script. so you can send WhatsApp msg as scheduled.
Sometimes we cant wish our close people on their birthday or other special occasions at the right time. so there you can use the help of python. he will do that for you. it will open your browser and go to WhatsApp web and send the msg to your loved one at the right time. is that great right.
so I am telling you that can be done within 2 lines of code. Yes, you heard me.
then we have to include our dependencies for our project. Open your terminal and download the dependency
pip install pywhatkit
after installing this we can open our code editor and lets write this code
import pywhatkit pywhatkit.sendwhatmsg("+91123456789","test",16,44,20) #number with country code
I will explain the function.
pywhatkit.sendwhatmsg(“phone_num “,”message “,time_hour, time_min, wait_time)
Okay, that’s done. now, what if you want to send an image ??
Let’s make that ..
import pywhatkit pywhatkit.sendwhats_image(phone_no="+918129505560", img_path="C:/Users/Ajith/Pictures/pic.jpg", caption="test message", wait_time=15)
we cant add the exact time for sending images but we can add wait time from now.
Yes, now you simply schedule the messages and get into your bed watch Netflix or prime to relax. the python will do the rest for you.
Don’t too much trust him. 😛
Subscribe to our weekly Newsletter and stay tuned.
Free PHP Invoicing Software
Gmax CRM Lite is an Invoicing and project management tool for small businesses, features including client management , invoicing , quotation and project managementDownload for free