-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
31 lines (23 loc) · 795 Bytes
/
app.py
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
from flask import Flask, request, render_template
from classify import main, classify
app = Flask(__name__)
@app.route('/', methods=["GET", "POST"])
def gfg():
if request.method == "POST":
gc = request.form.get("gc")
pop = request.form.get("pop")
spc = request.form.get("spc")
bs = request.form.get("bs")
sr = request.form.get("sr")
gillColor = int(gc)
population = int(pop)
sporePrintColor = int(spc)
bruises = int(bs)
stalkRoot = int(sr)
userSelection = main(gillColor, population,
sporePrintColor, bruises, stalkRoot)
message = classify(userSelection)
return message
return render_template("gfg.html")
if __name__ == '__main__':
app.run()