Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from flask import Flask, send_from_directory, render_template,request
- import re
- app = Flask(__name__)
- @app.route("/", methods=['POST', 'GET'])
- def main():
- return send_from_directory('template', 'First_window.html')
- @app.route("/login", methods=['POST','GET'])
- def Yes():
- if request.method == "POST":
- if request.form['answer'] == 'a1':
- return send_from_directory('Html', 'tests.html')
- return send_from_directory('template', 'First_window.html')
- @app.route("/File",methods=['POST','GET'])
- def File():
- if request.methods == "POST":
- f = request.files['file'].read()
- txt = str(f.decode('utf-8'))
- return send_from_directory('Html', 'tests.html')
- if __name__ == '__main__':
- app.run(debug=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement