박은주

Web Server

Showing 1 changed file with 22 additions and 0 deletions
1 +from flask import Flask, render_template
2 +
3 +from SentimentAnalyzer import StartSentimentAnalysis
4 +from content import GetData
5 +
6 +app = Flask(__name__)
7 +
8 +@app.route('/')
9 +def main():
10 + GetData()
11 + tot, positive, neutral, negative = StartSentimentAnalysis()
12 + return render_template('index.html', data = {
13 + 'total' : tot,
14 + 'positive' : int(positive / tot * 100),
15 + 'neutral' : int(neutral / tot * 100),
16 + 'negative' : int(negative / tot * 100),
17 + })
18 +
19 +if __name__ == "__main__":
20 + app.run(port="23023", debug=True)
21 + # host 등을 직접 지정하고 싶다면
22 + # app.run(host="127.0.0.1", port="5000", debug=True)
...\ No newline at end of file ...\ No newline at end of file