-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathWikepedia.py
42 lines (33 loc) · 1.17 KB
/
Wikepedia.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
import tkinter
from tkinter import *
import wikipedia as Wk
window=Tk()
window.title("My Wikipedia")
window.config(bg="black")
f1_heading=Frame(window)
f2_frame=Frame(window)
f3_frame=Frame(window)
Label(f1_heading,text="Wikipedia",font=("Times",30,"bold"),bg="White").pack(side=TOP)
Label(f2_frame,text="Search",font=("Times",20,"bold"),bg="lightgreen").pack(side=LEFT)
Label(f3_frame,text="Searched Result",font=("Times",25,"bold"),bg="orange").pack(side=LEFT)
entry_box=Entry(f2_frame,width=40,font=("Times",20,"bold"))
entry_box.pack(side=LEFT,fill=BOTH,expand=5)
entry_box.focus_set()
query=' '
text=Text(window,font=("Times",17,"bold"),bg="lightpink",pady=10,padx=55)
def text_Search():
global query
query=entry_box.get()
try:
txt_summary=Wk.summary(query)
text.insert('1.0',txt_summary)
except:
txt_summary=Wk.summary(query)
text.insert('1.0',txt_summary)
button1=Button(f2_frame,text="Search",command=text_Search,font=("Times",20,"bold"),bg="Blue",fg="Purple")
button1.pack(side=RIGHT)
f1_heading.pack()
f2_frame.pack(side=TOP)
f3_frame.pack(side=TOP,pady=20,padx=50)
text.pack()
window.mainloop()