37 lines
984 B
Python
37 lines
984 B
Python
# based on https://gist.github.com/rduplain/1641344
|
|
|
|
import random
|
|
from io import BytesIO
|
|
import base64
|
|
from flask import Flask, make_response, request
|
|
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
|
|
from matplotlib.figure import Figure
|
|
import plots
|
|
|
|
app = Flask(__name__)
|
|
|
|
@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() |