18 lines
449 B
Python
18 lines
449 B
Python
from flask import Flask, render_template, request
|
|
|
|
app = Flask(__name__)
|
|
|
|
|
|
@app.route('/', methods=['GET', 'POST'])
|
|
def index():
|
|
if request.method == "POST":
|
|
# getting input with name = fname in HTML form
|
|
instring = request.form.get("instring")
|
|
outstring = instring.replace(" ", "-")
|
|
return outstring
|
|
return render_template("index.html")
|
|
|
|
|
|
if __name__ == '__main__':
|
|
serve(app, host='0.0.0.0', port=8000)
|