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 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.
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-tkalong with pywhatkit
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.
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")
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.