forked from larymak/Python-project-Scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdictionary.py
More file actions
56 lines (44 loc) · 1.41 KB
/
Copy pathdictionary.py
File metadata and controls
56 lines (44 loc) · 1.41 KB
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
55
56
from tkinter import *
from PyDictionary import PyDictionary
# Create a window
dictionary = PyDictionary()
root = Tk()
# set geometry
root.title("Dictionary")
root.geometry("600x400+50+50")
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, buttons and frame
Label(root, text="My Dictionary", font=(
"Poppins, 20 bold"), fg="Orange").pack(pady=20)
# Frame 1
frame = Frame(root)
Label(frame, text="Enter word: ", font=(
"Helvetica, 15 bold")).pack(side="left")
word = Entry(frame, font=("Helvetica, 15 bold"), width=30)
word.pack()
frame.pack(pady=10)
# Frame 2
frame1 = Frame(root)
Label(frame1, text="Meaning: ", font=("Aerial, 15 bold")).pack(side=LEFT)
meaning = Label(frame1, text="", font=("Poppins, 15"))
meaning.pack()
frame1.pack(pady=10)
# Frame 3
frame2 = Frame(root)
Label(frame2, text="Synonym: ", font=(
"Roboto, 15 bold")).pack(side=LEFT)
synonym = Label(frame2, text="", font=("Roboto, 15"))
synonym.pack()
frame2.pack(pady=10)
# Frame 4
frame3 = Frame(root)
Label(frame3, text="Antonym: ", font=("Helvetica, 15 bold")).pack(side=LEFT)
antonym = Label(frame3, text="", font=("Helvetica, 15"))
antonym.pack(side=LEFT)
frame3.pack(pady=10)
Button(root, text="Search", font=("Helvetica, 15 bold"), command=dict).pack()
# Execute Tkinter
root.mainloop()