I am trying to put together a simple text box in tkniter with a spell check integrated. I have looked at pyenchant and I am not sure how to integrate it into the tkinter text box, or if I should look at an entirely different spell checker.
import enchant
import tkinter as tk
from enchant.tokenize import get_tokenizer
#Tokenizer for the spell check
sc = get_tokenizer("en_US")
#Window
window = tk.Tk()
#Text box to be checked
words = tk.Text(width=50)
sc
#Window layout
words.grid(row=1, column=1, padx=1.5, pady=1.5)
window.mainloop()
Ideally you need something to tell you the text content has changed and then get the data and run the enchant functions on it. You can then indicate misspellings using a text widget tag to change the appearance of the word.
Here is an example.