-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.py
24 lines (19 loc) · 796 Bytes
/
run.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
from flask import Flask, render_template
import csv
app = Flask(__name__)
@app.route("/")
def template_test():
results = []
with open('indies.csv') as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
with open('movietitles.txt', 'r') as inF:
for line in inF:
title = line.split('(')[0].lower()
if row['Title'].lower() in title:
row['IMDb_rating'] = row['IMDb Rating']
results.append(row)
# print('Title: ', row['Title'], 'IMDB Rating: ', row['IMDb Rating'], 'Year: ', row['Year'])
return render_template('template.html', my_string="Wheeeee!", results=results)
if __name__ == '__main__':
app.run(debug=True)