Flask

mail@pastecode.io avatar
unknown
python
a year ago
446 B
1
Indexable
Never
from flask import Flask, render_template, request

app = Flask(__name__)

@app.route('/', methods=['GET', 'POST'])
def index():
    if request.method == 'POST':
        user_input = request.form['user_input']
        result = my_function(user_input)
        return render_template('result.html', result=result)
    else:
        return render_template('form.html')

def my_function(input_string):
    # Your code here
    # ...
    return result