Skip to content

Commit 374b9e9

Browse files
authored
Create wiki_search.py
1 parent 92ae6c1 commit 374b9e9

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

wiki_search.py

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from tkinter import *
2+
import wikipedia
3+
4+
root = Tk()
5+
root.title("Wiki")
6+
root.geometry("400x400")
7+
8+
frame = Frame(root)
9+
input = Entry(frame, width = 50)
10+
input.pack()
11+
result = ''
12+
text = Text(root, font = ('ariel',20))
13+
14+
def search():
15+
global result
16+
result = input.get()
17+
summary = wikipedia.summary(result, sentences=3)
18+
text.insert('1.0',summary)
19+
20+
button = Button(frame, text = 'Search', command = search)
21+
button.pack(side = RIGHT)
22+
frame.pack(side = TOP)
23+
text.pack()
24+
root.mainloop()

0 commit comments

Comments
 (0)