Text to handwriting:-
As a student, I need to write a lot of things. This takes more time than typing. So what will be if we can convert our computer type to handwriting. Well, it will save your time and will be very fun. In this project, we will work on this project and it will really help you.
Libraries:-
For creating a user interface(UI) we will use python's Tkinter library.
To convert text into handwriting we will use the pywhatkit library.
Installation:-
Tkinter:- pip install tkinter
Pywhatkit:- pip install pywhatkit
Code:-
import tkinter as tk
from tkinter import font
import pywhatkit as py
from PIL import Image as img
# Top level window
frame = tk.Tk()
frame.title("text to handwriting")
tk.Label(frame,text="Enter your sentence",font="lucida 20 bold").pack()
frame.geometry('400x200')
# Function for getting Input
# from textbox and printing it
# at label widget
def prinoutput():
inp = inputtxt.get(1.0, "end-1c")
py.text_to_handwriting(inp,save_to="sup.png", rgb=(0,0,138))
im = img.open('sup.png')
im.show()
# TextBox Creation
inputtxt = tk.Text(frame,width=100,)
inputtxt.pack()
# Button Creation
printButton = tk.Button(frame,text = "Submit",command = prinoutput)
printButton.pack()
# Label Creation
lbl = tk.Label(frame, text = "")
lbl.pack()
frame.mainloop()
Github:-
You can also get this code from here
Comments
Post a Comment