Skip to content

Commit 86b78de

Browse files
Merge pull request #101 from archana-1209/add-SearchEditGUIApplication
Add Search And Edit Apllication
2 parents 8736a10 + 220ccfc commit 86b78de

3 files changed

Lines changed: 55 additions & 0 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Search_and_Edit
2+
When you type something into the search bar , the Search and Edit app will pull up information about it from Wikipedia .
3+
By enabling the Editor function, you can use it as a text editor and can disable the editor function just as easily .
4+
The Graphical User Interface has been designed using tkinter and the mini project is based on Python .
38.2 KB
Loading
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
from tkinter import *
2+
import wikipedia
3+
from tkinter import messagebox
4+
5+
class searchwiki:
6+
def __init__(self,root):
7+
self.root=root
8+
self.root.title("The Searching and Editing App")
9+
self.root.geometry("1360x740+0+0")
10+
self.root.config(bg="#262626")
11+
12+
title=Label(self.root,text="SEARCH and EDIT",font=("times new roman",35,"bold"),bg="white",fg="black").place(x=0,y=0,relwidth=1)
13+
14+
frame1=Frame(self.root,bd=2,relief=RIDGE)
15+
frame1.place(x=20,y=130,width=1330,height=550)
16+
17+
self.var_search=StringVar()
18+
txt_word=Entry(self.root,textvariable=self.var_search,font=("times new roman",20)).place(x=100,y=82,width=500)
19+
20+
btn_search=Button(self.root,text="Search",command=self.searchword,font=("times new roman",15,"bold"),bg="#262626",fg="white").place(x=620,y=80,height=40,width=120)
21+
btn_clear=Button(self.root,text="Clear",command=self.clear,font=("times new roman",15,"bold"),bg="#262626",fg="white").place(x=750,y=80,height=40,width=120)
22+
btn_enable=Button(self.root,text="Enable Editor",command=self.enable,font=("times new roman",15,"bold"),bg="#262626",fg="white").place(x=880,y=80,height=40,width=210)
23+
btn_disable=Button(self.root,text="Disable Editor",command=self.disable,font=("times new roman",15,"bold"),bg="#262626",fg="white").place(x=1100,y=80,height=40,width=210)
24+
25+
scrolly=Scrollbar(frame1,orient=VERTICAL)
26+
scrolly.pack(side=RIGHT,fill="y")
27+
28+
self.txt_area=Text(frame1,font=("times new roman",15),yscrollcommand=scrolly.set)
29+
self.txt_area.pack(fill=BOTH,expand=1)
30+
scrolly.config(command=self.txt_area.yview)
31+
32+
def enable(self):
33+
self.txt_area.config(state=NORMAL)
34+
35+
def disable(self):
36+
self.txt_area.config(state=DISABLED)
37+
38+
def clear(self):
39+
self.var_search.set("")
40+
self.txt_area.delete('1.0',END)
41+
42+
def searchword(self):
43+
if self.var_search.get()=="":
44+
messagebox.showerror("ERROR","Search box shouldn't be empty")
45+
else:
46+
fetch_data=wikipedia.summary(self.var_search.get())
47+
self.txt_area.insert('1.0',fetch_data)
48+
49+
root=Tk()
50+
obj=searchwiki(root)
51+
root.mainloop()

0 commit comments

Comments
 (0)