From c25a04b520a1da1604a13e4fd764f284e01742d6 Mon Sep 17 00:00:00 2001 From: Boyana Date: Thu, 4 May 2023 13:12:48 +0200 Subject: [PATCH] test py file --- test.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 test.py diff --git a/test.py b/test.py new file mode 100644 index 0000000..7fb3b22 --- /dev/null +++ b/test.py @@ -0,0 +1,31 @@ +from flask import Flask, request + +app = Flask(__name__) + +html_template = """ +

transformations

+
+ +

+ +
+""" + +@app.route("/", methods=["POST","GET"]) +def transformations(): + if request.method == "POST": + + search = request.form["search"] + + result_list = [] + for character in search: + unicode_point = format(ord(character)) + result_list.append(character + " " + unicode_point) + + result_string = "
\n".join(result_list) + + return html_template + f"
{ result_string }
" + + if request.method == "GET": + + return html_template \ No newline at end of file