Tkinter is an inbuild standard library in python so there is no need of installing it separately. But for creating the application we need the Wikipedia API.
Run 'pip install Wikipedia
After installing, import modules.
from tkinter import *import wikipedia as wk# UIroot = Tk()root.title("Wikipedia Mini")heading = Frame(root)frame = Frame(root)result = Frame(root)Label(heading,text = "Wikipedia Mini",pady = 20,font = ('Times', 30, 'bold')).pack(side = TOP)Label(frame, text = 'Search here:').pack(side = LEFT)Label(result,text = 'Search results:',pady = 1,font = ('Arial', 17)).pack(side = LEFT)input_box = Entry(frame, width = 50)input_box.pack(side = LEFT, fill = BOTH, expand = 5)input_box.focus_set()query = ''text = Text(root, font = ('Roboto',13), padx = 55, pady = 10)# search functiondef Search():global queryquery = input_box.get() # Query from input boxtry:summary = wk.summary(query) # Search Summarytext.insert('1.0',summary)except:text.insert('1.0',"No results")
After running the above code a window will pop up with the interface like this.
And we have done!. Now we have a Wikipedia GUI Search application built in our own way. You can bring changes to the interface and can add more functionality like speech recognition.