Computer Science, asked by abhisheksheel2836, 1 year ago

How to get a value using flask, from a selected option in a drop down list?

Answers

Answered by Basima
1

Answer:

from flask import Flask, render_template,request, redirect, url_for

app = Flask(__name__)

def template(title = "HELLO!", text = ""):

templateDate = {

'text' : text

}

return templateDate

@app.route("/threshold", methods=['POST'])

def threshold():

tvalue= (request.form.get['tvalue']) #get value from dropdown

msg= ""

if tvalue>3:

msg= "rating above 3"

templateData = template(text = msg) #display text using template()

#templateData = template(text = tvalue) #tried to print the value selected

return render_template('index.html'

Answered by Viann
0

I don't know reh bhaiya

Similar questions