-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
executable file
·45 lines (45 loc) · 1.4 KB
/
app.py
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
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/python3.6
# -*- coding: utf-8 -*-
import json
from flask import Flask, request
from code1 import anagram
app = Flask(__name__)
app.config["DEBUG"] = True
@app.route("/", methods=["GET", "POST"])
def adder_page():
if request.method == "POST":
word= request.form["word1"]
result1= json.dumps(anagram(word))
return '''
<html>
<body>
<br/>
<center><font size="5">Anagrams {result}</font></center>
<br/>
<center><a href="/"><font size="5">Click here to find again</font></a></center>
</body>
</html>
'''.format(result=result1)
return '''
<html>
<head>
<style>
p.big {
line-height: 1.8;
}
</style>
</head>
<body>
<p class="big">
<h1 style ="font-family: verdana;"><center>This page will accept a single word and show all possible anagrams.</center></h1>
<center><font size="6">Enter word:</font></center>
<br/>
<form method="post" action=".">
<center><input name="word1" size="50"/></center>
<br/>
<center><input type="submit" value="Find Anagrams" style = "font-size:20px; height:40px; width:150px"/></center>
</form>
</p>
</body>
</html>
'''