Text to handwriting | Python

Text to handwriting | Python

Hi, guys, these days I was playing a little with pywhatkit library, you know, the one I used in this post to send WhatsApp messages from Python. The point is that I came across with this pywhatkit's feature really, really interesting, as you can see in the title the function I am talking about is: convert text to hand written characters.

pywhatkit library

image.png

Pywhatkit is Python library with some great features, such as: sending WhatsApp messages at certain time, Google searching, converting images to ASCII, sending emails, among others features.

Requirements

First things first, you have to install pywhatkit library, so you have to open your command prompt and enter this pip command:

pip install pywhatkit

After that you can now import the library as following:

import pywhatkit as pw

I used pw to create an alias to the library, but you can name it as you want.

In some cases you will have to install python3-tk along with pywhatkit

Parameters

We need 3 parameters (2 optional) to make it work.

  • the text you want to convert to handwriting text.
  • save_to (optional): the path you want to save the image.
  • rgb (optional): color of the handwriting text in rgb format.

Example

Now we are able to try this feature.

Here's the code:

import pywhatkit as pw

txt = "jeffcoding.com"

pw.text_to_handwriting(txt, "image.png")

Result

image2.png


If you want to know the other features deeply you can click here

That's all for now, if I missed something let me know in the comments.