def encrypt(): text1 = request.form['text'] rot1 = request.form['rot'] rotated = rotate_string(text1,int(rot1)) print(rotated) new_text = rotated updated_form = form.format(new_text) return updated_form
def encrypt(): #ROT VALUE HANDLING rot_value = request.form['rot'] try: rot_value = int(rot_value) except ValueError: return render_template('value_error_template.html', invalid_char="'" + rot_value + "'") #MESSAGE HANDLING user_message = request.form['text'] encrypted_message = rotate_string(user_message, rot_value) return render_template('caeser_form.html', success_banner="YOUR ENCRYPTED MESSAGE:", message=encrypted_message)
def encrypt(): solution = rotate_string(request.form['text'], int(request.form['rot'])) return form.format(solution)
def encrypt(): rot = int(request.form['rot']) text = request.form['text'] rotated = rotate_string(text, rot) return form.format(rotated)
def encrypt(): rot = int(request.form["rot"]) text = request.form["text"] encrypted_text = rotate_string(text, rot) return form.format(encrypted_text)
def encrypt(): user_string = request.form['text'] rot = int(request.form['rot']) return form.format(rotate_string(user_string, rot))
def encrypt(): rot = int(request.form['rot']) text = request.form['text'] output = rotate_string(text, rot) return redirect("/?text=" + output)
def encrypt(): rotate_number = int(request.form['rot']) string = request.form['text'] if request.method == 'POST': message = rotate_string(string, rotate_number) return "<h1>" + form.format(message) + "</h1>"