Frage-Formular
This commit is contained in:
parent
64b69bd628
commit
794d2af1bf
1 changed files with 11 additions and 0 deletions
11
app.py
11
app.py
|
|
@ -8,3 +8,14 @@ def hello():
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
app.run(host="0.0.0.0", port=9006) # 90 + Raumnummer
|
app.run(host="0.0.0.0", port=9006) # 90 + Raumnummer
|
||||||
|
@app.route("/frage", methods=["GET", "POST"])
|
||||||
|
def frage():
|
||||||
|
if request.method == "POST":
|
||||||
|
if request.form["antwort"] == "8":
|
||||||
|
return "Richtig!"
|
||||||
|
return "Leider falsch."
|
||||||
|
return '<form method="post">Was ist 3 + 5? ' \
|
||||||
|
'<input name="antwort"><button>OK</button></form>'
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
app.run(host="0.0.0.0", port=9006) # 90 + Raumnummer
|
||||||
Loading…
Reference in a new issue