initial import

This commit is contained in:
2021-05-31 14:45:59 +02:00
parent 1ec9c03f20
commit 6d29156977
9 changed files with 136 additions and 1 deletions

29
app.py Normal file
View File

@@ -0,0 +1,29 @@
from flask import Flask, render_template, url_for, request, redirect, Response, abort, session
from flask_sqlalchemy import SQLAlchemy
from datetime import datetime
import magic
import random
import string
app = Flask(__name__)
app.secret_key = 'eng5iikeiwah3lae4idoo0woh4eiy6Th'
@app.route('/', methods = ['GET', 'POST'])
def index():
if request.method == 'POST':
alle = []
zufall = []
for r in request.form.getlist('rechenreihen'):
for i in range(1,11):
alle.append({str(r)+"x"+str(i): int(r)*int(i) })
while len(alle):
zufall.append(alle.pop(random.randint(0,len(alle)-1)))
return render_template('arbeitsblatt.html',aufgaben=zufall)
else:
return render_template('generator.html')
if __name__ == "__main__":
app.run(debug=True)