Skip to content

Commit 643aa59

Browse files
committed
Finished updating wiki.py
I put everything in a main class In the previous version the answer text box did not update now it does. I binded the enter key to the search function (summary)
1 parent 44af5b2 commit 643aa59

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

wiki/requirements.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
wikipedia
22
tkinter
3-
PIL

wiki/wiki.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import wikipedia
55
import tkinter as tk
66
from tkinter import *
7-
import PIL as ImageTK
7+
#import PIL as ImageTK
88
from tkinter import messagebox
99

1010

@@ -47,7 +47,7 @@ def __init__(self, root):
4747
relief=GROOVE,
4848
bg="#4cd137",
4949
bd=3,
50-
command=self.summary,
50+
command=lambda:self.summary("None"),
5151
)
5252
self.searchbtn.pack()
5353

@@ -63,7 +63,7 @@ def __init__(self, root):
6363

6464
self.root.bind("<Return>", self.summary)
6565

66-
def summary(self):
66+
def summary(self, event):
6767
self.query = wikipedia.page(self.question.get())
6868
self.answer.delete('1.0', END)
6969
self.answer.insert(END, (self.query.summary))

0 commit comments

Comments
 (0)