diff --git a/__pycache__/main.cpython-39.pyc b/__pycache__/main.cpython-39.pyc index c544e39..4109b36 100644 Binary files a/__pycache__/main.cpython-39.pyc and b/__pycache__/main.cpython-39.pyc differ diff --git a/__pycache__/plots.cpython-39.pyc b/__pycache__/plots.cpython-39.pyc index 3cec243..44d9cdd 100644 Binary files a/__pycache__/plots.cpython-39.pyc and b/__pycache__/plots.cpython-39.pyc differ diff --git a/main.py b/main.py index 2d7ae8d..9e3badf 100644 --- a/main.py +++ b/main.py @@ -3,7 +3,7 @@ import random from io import BytesIO import base64 -from flask import Flask, make_response, request +from flask import Flask, make_response, request, render_template from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from matplotlib.figure import Figure import plots @@ -11,27 +11,18 @@ import plots app = Flask(__name__) @app.route('/') -def plot_figure(): - return plots.plot() +def my_form(): + return render_template('index.html') + +@app.route('/', methods=['POST']) +def my_form_post(): + text = request.form['text'] + processed_text = text.upper() + return processed_text + +# @app.route('/') +# def plot_figure(): +# return plots.plot() if __name__ == '__main__': - app.run(debug=True, port=5002) - -# from flaskapp import * -# from plots import Cijferlijst - -# import matplotlib.pyplot as plt -# from datetime import datetime -# import matplotlib.dates as mdates - -# if __name__ == "__main__": -# cf = Cijferlijst() -# data = cf.GetSubjectByYear("godsdienst", "2010/2011") - -# #Get dates and convert them to actual dates -# x = data['Datum invoer(Voortgangsdossier)'] -# x = [datetime.strptime(date, "%d-%m-%Y") for date in x] - -# y = data['Cijfer(Voortgangsdossier)'] -# y = [float(line.replace(",", ".")) for line in y] -# RunWeb() \ No newline at end of file + app.run(debug=True, port=5002) \ No newline at end of file diff --git a/plots.py b/plots.py index 75ef879..7664ecc 100644 --- a/plots.py +++ b/plots.py @@ -7,7 +7,9 @@ from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from matplotlib.figure import Figure import base64 -app = Flask(__name__) +# app = Flask(__name__) +GRADE_LIST = "Cijfers-HerrewijnenJonathan.csv" +print(GRADE_LIST) def plot(): # Generate the figure **without using pyplot**. @@ -25,7 +27,6 @@ def plot(): # import pandas as pd # import numpy as np -# GRADE_LIST = "Cijfers-HerrewijnenJonathan.csv" # class Cijferlijst: # def __init__(self, grade_list=GRADE_LIST): diff --git a/templates/index.html b/templates/index.html index 989b5f4..e79fa63 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,12 +1,18 @@ - - - - - - -

{{title}}

- img_data - + + + + + +
+ + +
+ + +

{{title}}

+ img_data + + \ No newline at end of file