How to Send automatic WhatsApp messages from Python

Table of Contents
  1. Installing python on windows
  2. Install python on Mac
    1. Install Pywhatskit to send messages on whatsapp
  3. Code to send WhatsApp Python messages

WhatsApp is the world's most popular mobile messaging application, and its simplicity makes it easy for anyone to use, besides its closest competitor (Telegram). Many businesses use WhatsApp to promote services or keep in touch with customers to provide services or sell products directly.

WhatsApp provides an enterprise version and a web version available from a browser, but in some cases it is necessary to automate certain processes, and these versions are not enough. In this brief but important tutorial, we will show you how to use Python to automatically send WhatsApp messages.

Miracle Box CRACK 2.28 NEW UPDATED VERSION

Installing python on windows

Let's get started with installing it! We want you to install the latest version of Python 3, so if you have an older version, you will need to upgrade. If you already have version 3.4 or higher, it should be fine.

Please install Python normally as follows, even if you have Anaconda installed on your computer.

First check whether your computer is running the 32-bit version of Windows or the 64-bit version, under "System type" on the "About" page. To get to this page, try one of these methods:

  • Press the Windows key and the Pause/Break key at the same time.
  • Open the Control Panel from the Windows menu, then go to System & Security, then System & Security, then System & Security, then System & Security, then System & Security, then System & Security, then System & Security, then System & Security, then System & Security.
  • Press the Windows button, then go to Settings > System > About > Settings > System > System > About.

You can download Python for Windows from the following web site https://www.python.org/downloads/windows/. Click on the "Latest Python 3 Release -Python x.x.x" link. If your computer is running the 64-bit for Windows, download Windows x86-64 executable installer. Otherwise, download Windows x86 executable installer. After downloading the installer, you should run it (by double clicking on it) and follow the instructions.

One thing to note: During installation, you will see a "Setup" window. Be sure to check the "Add Python 3.6 to PATH" or "Add Python to your environment variables" boxes and click "Install Now", as shown here (it may look a little different if you are installing a different version):

Don't forget to add Python to the Path

 

open cmd and check your installation :

python --version

Install python on Mac

go to System Preferences (it is in the Applications folder), click on "Security & Privacy" and then the "General" tab. If your "Allow apps downloaded from:" is set to "Mac App Store," change it to "Mac App Store and identified developers. (Mac App Store and identified developers)

You need to go to the website https://www.python.org/downloads/release/python-361/ and download the Python installer:

  • Download the file Mac OS X 64-bit/32-bit installer,
  • Double click on python-3.6.1-macosx10.6.pkg to run the installer.

Install Pywhatskit to send messages on whatsapp

The first thing to do is to install the pywhatki library, which is available from PYPI and can be installed using the following command:

1.- pip install pywhatkit

Before executing the code it is necessary to be logged into the web version of WhatsApp.

Resultado de imagen de whatsapp web

The library must be imported to send a message, and when it is ready, we must use the following line of code:

pywhatkit.sendmsg ("receiver's mobile number", "message", hours, minutes)

  • Receiver's cell phone number: the recipient's mobile number must be in string format and the country code must be mentioned before the mobile number.
  • Message: Message to be sent (must be in string format).
  • Hours: This module follows the 24-hour format.
  • Minutes: mention the minutes of the programmed time for the message (00-59).

So, if you need to send a WhatsApp message to a specific number it is necessary to indicate the target WhatsApp number, the desired message, and include the hour and minute where the message should be sent.

Code to send WhatsApp Python messages

You can see the complete code here:

When the code is executed, a window will open where the message will be sent via WhatsApp web, and you will receive the message.

How to Hack Facebook with termux from your android WITHOUT ROOT

Leave a Reply

Go up

Cookies on this website are used to personalize content and ads, provide social media features and analyze traffic. More information

en_USEnglish