2022-09-18 13:11:54 +00:00
|
|
|
# based on https://gist.github.com/rduplain/1641344
|
|
|
|
|
|
|
|
import random
|
2022-09-22 15:15:32 +00:00
|
|
|
from io import BytesIO
|
|
|
|
import base64
|
2022-09-30 16:45:45 +00:00
|
|
|
from flask import Flask, make_response, request, render_template
|
2022-09-18 13:11:54 +00:00
|
|
|
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
|
|
|
|
from matplotlib.figure import Figure
|
2022-09-22 15:15:32 +00:00
|
|
|
import plots
|
2022-09-18 13:11:54 +00:00
|
|
|
|
|
|
|
app = Flask(__name__)
|
2021-09-20 20:39:36 +00:00
|
|
|
|
2022-09-18 13:11:54 +00:00
|
|
|
@app.route('/')
|
2022-09-30 16:45:45 +00:00
|
|
|
def my_form():
|
|
|
|
return render_template('index.html')
|
2022-09-18 13:11:54 +00:00
|
|
|
|
2022-09-30 16:45:45 +00:00
|
|
|
@app.route('/', methods=['POST'])
|
|
|
|
def my_form_post():
|
|
|
|
text = request.form['text']
|
|
|
|
processed_text = text.upper()
|
|
|
|
return processed_text
|
2022-09-18 13:11:54 +00:00
|
|
|
|
2022-09-30 16:45:45 +00:00
|
|
|
# @app.route('/')
|
|
|
|
# def plot_figure():
|
|
|
|
# return plots.plot()
|
2022-09-18 13:11:54 +00:00
|
|
|
|
2022-09-30 16:45:45 +00:00
|
|
|
if __name__ == '__main__':
|
|
|
|
app.run(debug=True, port=5002)
|