-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdictionary.py
54 lines (42 loc) · 1.37 KB
/
dictionary.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Import Required Library
from tkinter import *
from PyDictionary import PyDictionary
# Create Objects
dictionary = PyDictionary()
root = Tk()
# Set geometry
root.geometry("400x400")
def dict():
meaning.config(text=dictionary.meaning(word.get())['Noun'][0])
synonym.config(text=dictionary.synonym(word.get()))
antonym.config(text=dictionary.antonym(word.get()))
# Add Labels, Button and Frames
Label(root, text="Dictionary", font=(
"Helvetica 20 bold"), fg="Green").pack(pady=10)
# Frame 1
frame = Frame(root)
Label(frame, text="Type Word", font=("Helvetica 15 bold")).pack(side=LEFT)
word = Entry(frame, font=("Helvetica 15 bold"))
word.pack()
frame.pack(pady=10)
# Frame 2
frame1 = Frame(root)
Label(frame1, text="Meaning:- ", font=("Helvetica 10 bold")).pack(side=LEFT)
meaning = Label(frame1, text="", font=("Helvetica 10"))
meaning.pack()
frame1.pack(pady=10)
# Frame 3
frame2 = Frame(root)
Label(frame2, text="Synonym:- ", font=("Helvetica 10 bold")).pack(side=LEFT)
synonym = Label(frame2, text="", font=("Helvetica 10"))
synonym.pack()
frame2.pack(pady=10)
# Frame 4
frame3 = Frame(root)
Label(frame3, text="Antonym:- ", font=("Helvetica 10 bold")).pack(side=LEFT)
antonym = Label(frame3, text="", font=("Helvetica 10"))
antonym.pack(side=LEFT)
frame3.pack(pady=10)
Button(root, text="Submit", font=("Helvetica 15 bold"), command=dict).pack()
# Execute Tkinter
root.mainloop()