Frage und Pinnwand Versuch

This commit is contained in:
Lena 2026-06-17 16:28:51 +02:00
parent 8de7fa76e1
commit dbd83b4edd

View file

@ -15,5 +15,20 @@ def pinnwand():
'<form method="post"><input name="nachricht">' \
'<button>Senden</button></form><ul>' + liste + '</ul>'
@app.route("/")
def hello():
return "Hallo aus meiner Flask-App!"
@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=9008)