Spelling Checker Program using Python Tkinter 

spelling checker program

Hello coders we create this project with Python Tkinter 

  •   In this project we create spelling checker program

Libraries used-

>>Tkinter(for GUI)

>>Pillow(for Backgroung Image)

>>textblob(for spelling correction)

Step to create GUI-

  • Install Tkinter using pip install
  • Install Pillow using pip install
  • Install textblob using pip install
  • Import Tkinter
  • Create the main window
  • Import png button

Algorithm-

  • Import background imageby PIL module .
  • Create window and entry box for Word Entry
  • Create Text box for output
  • Create function of spell-checker using textblob
  • Create button and add command    

Source Code:

#Importing Libraries----------------------------------------------------------------------------------------

import tkinter

from tkinter import *

from PIL import ImageTk, Image

from tkinter import ttk

from textblob import TextBlob



screen=Tk()

#-----------------------------------------------------------------------------------------------------------

#For putting Icon

image_icon=PhotoImage(file="logo.png")

screen.iconphoto(False,image_icon)



#-----------------------------------------------------------------------------------------------------------

#For putting title

screen.title("Spelling Checker Tool")



#-----------------------------------------------------------------------------------------------------------

#For putting Image as background

screen.geometry("800x500+0+0")

img = ImageTk.PhotoImage(Image.open("base.png"))

panel = Label(screen, image = img)

panel.place(x=0,y=0)





#Spelling Check Function------------------------------------------------------------------------------------

def check():

    word=E1.get()

    a=TextBlob(word)

    right=str(a.correct())



    L3=Label(screen,text="Correct Spelling Is:",font=("Cambria",25,"bold"),fg="white",bg="#069FB8")

    L3.place(x=180,y=250)

    L2.config(text=right)     



#entry box--------------------------------------------------------------------------------------------------

E1=Entry(screen,font=("Time New Roman",18,"bold"),fg="#20B2AA",relief=GROOVE,bd=3)

E1.place(x=200,y=107,width=370,height=40)

E1.insert(0,"Enter Text here to check")



def click(event):

    E1.delete(0,END)

    E1.insert(0,'')



E1.bind('<FocusIn>',click)



#Check Button-----------------------------------------------------------------------------------------------

B1=Button(screen,text="CHECK",font=("Cambria",15,"bold"),fg="white",bg="#5BB55E",width=30,command=check)

B1.place(x=200,y=170)



#-----------------------------------------------------------------------------------------------------------

L2=Label(screen,font=("Cambria",25,"bold"),fg="red",bg="#069FB8")

L2.place(x=480,y=250)



screen.mainloop()


Output:

spelling checker program

 spelling checker program
 spelling checker program

Write a comment