from flask import Flask, request, render_template, make_response, redirect app = Flask(__name__) app.config["TEMPLATES_AUTO_RELOAD"] = True import command @app.route("/") def index(): return render_template("index.html") @app.route("/tv/") def action_tv(cmd): command.send_code(cmd, "tv") #return redirect("/", code=307) return "

Sent '{0}'

".format(cmd) @app.route("/mb/") def action_mb(cmd): command.send_code(cmd, "mb") #return redirect("/", code=307) return "

Sent '{0}'

".format(cmd)