-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhello_flask.py
More file actions
33 lines (25 loc) · 797 Bytes
/
Copy pathhello_flask.py
File metadata and controls
33 lines (25 loc) · 797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from flask import Flask,render_template,request
from vsearch import search4letters
app=Flask(__name__)
# @app.route("/categories") #writing route
# def F2()->str:
# return "Hello Categories"
@app.route("/search4",methods=["POST"])
def do_search()->"html":
phrase=request.form["phrase"]
letters=request.form["letters"]
title="Welcome to the search4letters website"
res= str(search4letters(phrase,letters))
print(res)
return render_template("results.html",
the_title=title,
the_phrase=phrase,
the_letters=letters,
the_result=res
)
@app.route("/") #annotation
@app.route("/entry")
def entry_page()->"html":
title="Welcome to the search4letters website!"
return render_template("entry.html",the_title=title)
app.run(debug=True)