

Set the window you want to place the label in, the text it should have, and the font styles along with the font color. nfig(text=dictionary.synonym( 'en', word.get()))Īnfig(text=dictionary.antonym( 'en', word.get()))ĭefine a label to display the name of the application. These methods each return a list that you can pass directly to config(). Extract the second value from this tuple-the definition-and pass it to the nfig() method.Ĭall the synonym and antonym methods, passing the same parameters.

This method returns a tuple containing the word type, its dictionary definition, and its description from Wikipedia. Pass the language ("en" for English) and the word the user entered to the meaning method. This function will set the text of the meaning, synonym, and antonym labels to the result of each method call. Root.title( "Word Dictionary Using Python")ĭefine a function, dict(). from tkinter import *įrom PyMultiDictionary import MultiDictionary Set the title and dimensions of your application. Instantiate the MultiDictionary class and initialize the root window. You can find the source code of the Dictionary App in this GitHub repository.īegin by importing the Tkinter and the PyMultiDictionary modules.
