Python module Pywhatkit. Text to Handwriting and Automation

Python module Pywhatkit. Text to Handwriting and Automation

Python, as a common general-purpose programming language, has a wide range of features and applications. Python has several fantastic modules that can be used to automate a variety of tasks. Today, we'll look at the Pywhatkit python module's code examples, which automates –

  • Messages on WhatsApp
  • Playing a YouTube Video
  • Doing a Google search
  • Convert Text To Handwritten.

What exactly is Pywhatkit?

The Pywhatkit python module lets you automate WhatsApp messages and do other cool things. It can also be used to automate tasks such as playing a video, conducting a Google search, shutting down your computer, and much more.

The best part is that you can automate anything with only a few lines of code. That is why we adore it so much.

Let's Move on it

Install Pywhatkit using pip

pip install pywhatkit

To install the Pywhatkit package, type this code in the command prompt. We are now ready to automate everything.

After you've installed this module, Let's use this module to send an automated WhatsApp Message.

Pywhatkit can be used to automate WhatsApp messages. Now, let's look at the easiest way to send a message to any phone number using the WhatsApp web. All you have to do is go to your WhatsApp webpage in your browser and log in.  

After that Use the following command to import the library.

import pywhatkit

Let's use pywhatkit to send an automated message to WhatsApp after we've imported the Python library.

Message on WhatsApp

We can use the following command to send the WhatsApp message

pywhatkit.sendwhatmsg("+91xxxxxxxxxx","This is a message",17,00

import pywhatkit

pywhatkit.sendwhatmsg("+91xxxxxxxxxx","This is a message",15,00)

Let's update our code and add some new features, such as collecting users input.

Let's move on it and add some features to our existing Python code

import pywhatkit

while True:
print("please type the phone number with country code \n ")
number = input("Enter the Reciever number to send message \n >>>")
value = int(number)
message = input("Enter the message you want to send \n >>>")
time = input("Enter the time you want to send the message \n >>>")
min = input("Enter in which min you want to send the message \n >>>")
except ValueError:
print("This is not a number. Please enter a valid number")

We can get user input in this way.

Let's play a youtube video with this module

command pywhatkit.playonyt() opens your default browser to YouTube and plays the video you specified in the feature. It plays a random video on that subject if you pass the topic name as a parameter. It opens the specific video when the URL is passed as a parameter.

Let's move on to it. We can do it by a given command


This will start playing the first video that comes up when you search for "Coding" on YouTube.

import pywhatkit


After this let's take a look at how can we perform a google search using this module

Google Search Using this module

We can do it by the following command"coding")

import pywhatkit"coding")

Let's Look at how to convert text to a handwritten font using this module

Text to Handwritten font

This will transform the text to a handwritten font in RGB type with the color combination 0,0,0.

import pywhatkit

text = "Python is an interpreted high-level general-purpose programming language. " \
"Python's design philosophy emphasizes code readability with its notable use of significant indentation. " \
"Its language constructs as well as its object-oriented approach aim to help programmers write clear, " \
"logical code for small and large-scale projects"


We Get output like this 👇

Text to Handwriting output

Also want to know use of tkinter in python?. You can see from here 

Post a Comment

If you have any doubts. Let me know

Previous Post Next Post