-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
34 lines (26 loc) · 838 Bytes
/
app.py
File metadata and controls
34 lines (26 loc) · 838 Bytes
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
from tkinter import *
from main import analyse_tweet
# GUI begin
home = Tk()
home.title("TSA")
home.iconbitmap('twitter.ico')
# Heading
head = Label(home, text="Twitter Sentiment Analyzer")
head.pack(padx=15, pady=5)
# Input frame for required args
args = Frame(home)
args.pack(padx=10, pady=10, fill=X)
# Input field
Label(args, text="Enter the terms: ").grid(row=0, column=0)
tweet_terms = Entry(args, font=('MS Sans', 13))
tweet_terms.grid(row=0, column=1)
Label(args, text="Enter number of tweets: ").grid(row=1, column=0)
tweet_count = Entry(args, font=('MS Sans', 13))
tweet_count.grid(row=1, column=1)
args.grid_columnconfigure(0, weight=1)
analyse = Button(home, text="Analyse", command=analyse_tweet)
analyse.pack(pady=5)
# Result frame
result = Label(home, text="")
result.pack(fill=X, padx=10, pady=10)
home.mainloop()