def index(): global currList if request.method == "POST": inputString = request.form["array"] myList = [int(x) for x in inputString.split(',') if x] exchanges = True passnum = len(myList) - 1 while passnum > 0 and exchanges: currList.append(myList[:]) exchanges = False for i in range(passnum): if myList[i] > myList[i + 1]: exchanges = True temp = myList[i] myList[i] = myList[i + 1] myList[i + 1] = temp currList.append(myList[:]) passnum = passnum - 1 user_input.append(currList) return redirect(url_for('bubbleSort')) return render_template('index.html')
def index(): if request.method == "POST": name = request.form["name"] zID = int(request.form["zID"]) desc = request.form["desc"] user_input.append([name, zID, desc]) return redirect(url_for('hello')) return render_template("index.html")
def index(): if request.method == 'POST': name = request.form['name'] zID = request.form['zID'] desc = request.form['desc'] user_input.append((name, zID, desc)) return redirect(url_for('hello', name=name, id=zID, desc=desc)) return render_template('index.html')
def showpool(): if authentic: with open('questions.csv', 'r') as csv_in: reader = csv.reader(csv_in) for row in reader: user_input.append(row) return render_template("showpool.html", all_users=user_input) else: return redirect("/")
def helloAll(): with open('example.csv','r') as csv_in: reader = csv.reader(csv_in) for row in reader: user_input.append([row[0], row[1], row[2]]) print(row) redirect(url_for('helloPerson', name=row[0], id=row[1], desc=row[2])) return render_template('Hello.html', all_users=user_input)
def index(): if request.method == "POST": name = request.form["name"] password = request.form["password"] user_input.append([name, password]) if (name == "hansen" and password == "123"): return redirect(url_for("hello")) else: return redirect(url_for("try_again")) return render_template("index.html")
def index(): if request.method == "POST": name = request.form["name"] zID = int(request.form["zID"]) description = request.form["desc"] user_input.append([name, zID, description]) #with open('example','a') as csv_out: #writer = csv.writer(csv_out) #writer.writerow([name, zID, description]) write_to_csv("example.csv",[name, zID, description]) return redirect(url_for("hello")) return render_template("index.html")
def index(): if request.method == "POST": name = request.form["name"] zID = int(request.form["zID"]) description = request.form["desc"] with open('example.csv','a') as csv_out: writer = csv.writer(csv_out) writer.writerow([name, zID, description]) user_input.append([name, zID, description]) return redirect(url_for('helloAll')) return render_template('index.html')
def read(user_input): with open('example.csv', 'r') as csv_in: reader = csv.reader(csv_in) for row in reader: user_input.append(row)