Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 72c5333

Browse files
authored
bug fixed
1 parent 78d063d commit 72c5333

File tree

1 file changed

+6
-10
lines changed
  • EmotionClassifierApplication

1 file changed

+6
-10
lines changed

EmotionClassifierApplication/App.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
sys.path.append("..")
99
import EmotionClassifierModel.Models
1010

11-
global word
12-
1311
window = tk.Tk()
1412
window.title("Emotion Recognition Application")
1513
window.geometry("650x450+400+300")
@@ -19,6 +17,11 @@
1917

2018
f = tk.StringVar()
2119

20+
word = tk.Label(window, text='', font=("Segoe UI", 35))
21+
word.place(
22+
anchor="center", x=325, y=278
23+
)
24+
2225
img_dict = {-1: "imgs/-1.png", 0: "imgs/0.png", 1: "imgs/1.png"}
2326
lable_dict = {-1: "negative", 0: "neutral", 1: "positive"}
2427

@@ -52,14 +55,7 @@ def predict():
5255
label_img = tk.Label(image=img)
5356
label_img.image = img
5457
label_img.place(anchor="center", x=325, y=135)
55-
try:
56-
word.destroy()
57-
except:
58-
print("Word is not defined")
59-
word = tk.Label(window, text=lable_dict[result], font=("Segoe UI", 35))
60-
word.place(
61-
anchor="center", x=325, y=278
62-
)
58+
word['text'] = lable_dict[result]
6359

6460

6561
cbox = ttk.Combobox(

0 commit comments

Comments
 (0)