-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
30 lines (25 loc) · 707 Bytes
/
app.py
File metadata and controls
30 lines (25 loc) · 707 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
from flask import Flask,render_template
app = Flask(__name__)
@app.route('/')
def home():
data=open("data/cereal.csv","r")
fields=data.readline().split(",")
fields=fields[3:12]
return render_template("home.html",fields=fields)
@app.route('/cereal')
def cereal():
return render_template("cereal.html")
@app.route('/best')
def best():
return render_template("best.html")
@app.route('/histo')
def histo():
data=open("data/cereal.csv", "r")
fields=data.readline().split(",")
# print(fields);
fields=fields[3:12]
# print(fields);
return render_template("histo.html",fields=fields)
if __name__ == '__main__':
app.debug = True
app.run()