if(invalid){don't send;}

This commit is contained in:
FluffyCube9343 2022-11-12 16:03:23 -05:00
parent 5fe0a0ef59
commit 91b6386172

6
app.py
View File

@ -20,7 +20,8 @@ def homepage():
def sendData(): def sendData():
rot = request.form.get("rot") rot = request.form.get("rot")
try:
rot = int(rot)
print("Activated") print("Activated")
import socket import socket
s=socket.socket() s=socket.socket()
@ -33,7 +34,8 @@ def sendData():
s.close() s.close()
rece = "Confirm Sent: "+rece.decode("ASCII") rece = "Confirm Sent: "+rece.decode("ASCII")
return render_template("index.html", conf=rece) return render_template("index.html", conf=rece)
except ValueError:
return render_template("index.html", conf='Invalid Input "'+rot+'"')
if __name__ == "__main__": if __name__ == "__main__":
app.run(debug=True) app.run(debug=True)