Fix bug with spaces.
This commit is contained in:
parent
7e99be1dbe
commit
da30caaf49
|
@ -2,6 +2,7 @@
|
||||||
from flask import Flask, request, render_template
|
from flask import Flask, request, render_template
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import re
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
@ -12,6 +13,7 @@ def my_form():
|
||||||
@app.route('/', methods=['POST'])
|
@app.route('/', methods=['POST'])
|
||||||
def form_post():
|
def form_post():
|
||||||
text = request.form['secret']
|
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"
|
command = "python3 Caeser-Cipher/Caeser-Cipher.py encrypt " + str(text) + " 3"
|
||||||
ciphered_text = subprocess.check_output(command, shell=True)
|
ciphered_text = subprocess.check_output(command, shell=True)
|
||||||
return ciphered_text
|
return ciphered_text
|
||||||
|
|
Loading…
Reference in New Issue