Skip to content

Commit c4eb1cb

Browse files
authored
Create wikipedia_search_tkinter.py
1 parent 5f182e4 commit c4eb1cb

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

python/wikipedia_search_tkinter.py

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
from tkinter import *
2+
from tkinter.font import Font
3+
import wikipedia
4+
5+
6+
def search_me():
7+
entry_value=entry.get()
8+
answer_value =wikipedia.summary(entry_value)
9+
answer.delete(1.0,END)
10+
answer.insert(INSERT,answer_value)
11+
12+
window=Tk()
13+
window.geometry('500x400+150+100')
14+
topframe=Frame(window)
15+
16+
entry =Entry(topframe)
17+
entry.pack()
18+
19+
20+
button =Button(topframe,text ='search',command =search_me)
21+
button.pack()
22+
23+
topframe.pack(side =TOP)
24+
25+
bottomframe=Frame(window)
26+
27+
scroll =Scrollbar(bottomframe)
28+
scroll.pack(side =RIGHT,fill=Y)
29+
30+
answer = Text(bottomframe,width =50 ,height =20,yscrollcommand=scroll.set,wrap = WORD)
31+
answer.pack(side=LEFT)
32+
33+
scroll.config(command=answer.yview)
34+
35+
bottomframe.pack()
36+
37+
window.mainloop()

0 commit comments

Comments
 (0)