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.

so first You need Python and the PyCharm IDE on your pc  (or you can use any of your IDE) or download that.

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.  😛 

 

 

Post Your Questions on our forum

Post a question on Forum

Ajith Jojo Joseph

Self taught, dedicated young entrepreneur with many licensed products under his sleeve. Passionate about technology, business and excellence in general.

Share with your friends:

Comments are closed.

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 […]

September 11, 2021

Build your own Free Audio Book from PDF using Python

Hello everyone, In this tutorial, we are going to make an Audiobook from PDF using python.  As we know we […]

September 11, 2021

Download Instagram profile data with Python 3 Lines of code

Hello everyone, In this tutorial, we are going to download all the information including profile pics, posts, tags everything from […]

September 11, 2021

How to create Instagram Bot with InstaPy

Do you know how to create an Instagram bot with InstaPy. InstaPy is a python package, and we can use […]

March 31, 2021

Digital Marketing Toolkit

Get Free Access to Digital Marketing Toolkit. You can use all our tools without any limits

Get Free Access Now