-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWeb App Interfacing
31 lines (22 loc) · 1005 Bytes
/
Web App Interfacing
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
#Web App Interfacing (Anvil) by Tushar
from ._anvil_designer import Form1Template
from anvil import *
import anvil.server
class Form1(Form1Template):
def __init__(self, **properties):
# Set Form properties and Data Bindings.
self.init_components(**properties)
# Any code you write here will run before the form opens.
def outlined_button_1_click(self, **event_args):
"""This method is called when the button is clicked"""
sentiment_analysis = anvil.server.call('sentiment_score', self.statement.text)
if sentiment_analysis :
self.label1.visible = True
self.label1.text = "Mood level : ", sentiment_analysis.capitalize()
sentiment_analysis = anvil.server.call('sentiment_s', self.statement.text)
if sentiment_analysis :
self.label2.visible = True
self.label2.text = "Score : ", str(sentiment_analysis*10)
def rich_text_4_show(self, **event_args):
"""This method is called when the RichText is shown on the screen"""
pass