# based on https://gist.github.com/rduplain/1641344 import random from io import BytesIO import base64 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 app = Flask(__name__) @app.route('/') 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)