From da30caaf49cec2438c708a8fbf627967c893ff30 Mon Sep 17 00:00:00 2001 From: Josh Mudge Date: Fri, 22 Mar 2019 18:02:51 -0600 Subject: [PATCH] Fix bug with spaces. --- Web/app.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Web/app.py b/Web/app.py index 2ab389e..84da23e 100644 --- a/Web/app.py +++ b/Web/app.py @@ -2,6 +2,7 @@ from flask import Flask, request, render_template import os import subprocess +import re app = Flask(__name__) @@ -12,6 +13,7 @@ def my_form(): @app.route('/', methods=['POST']) def form_post(): text = request.form['secret'] + text = re.sub (r'([^a-zA-Z]+?)', '', text) # Remove all non-letters. command = "python3 Caeser-Cipher/Caeser-Cipher.py encrypt " + str(text) + " 3" ciphered_text = subprocess.check_output(command, shell=True) return ciphered_text