DAS_2023_1/alexandrov_dmitrii_lab_6/service.py

36 lines
616 B
Python
Raw Normal View History

2023-12-22 22:22:14 +04:00
from flask import Flask, redirect, request, render_template
import matrix
app = Flask(__name__, template_folder='')
results = ''
@app.route('/')
def home():
global results
return render_template("template.html", results_html=results)
@app.route('/do')
def do():
global results
data = request.args
results = matrix.get_results(int(data['size']), int(data['proc_num']))
return redirect("/")
@app.route('/benchmark')
def benchmark():
global results
results = matrix.get_benchmark()
return redirect("/")
if __name__ == '__main__':
app.run(host='0.0.0.0', port=8082)