Advertisement
llownall

Untitled

Jun 10th, 2020
1,220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. from flask import Flask, render_template, request
  2.  
  3. app = Flask(__name__)
  4. line = 'default'
  5.  
  6.  
  7. @app.route('/', methods=['GET', 'POST'])
  8. def index():
  9.     global line
  10.     if request.method == 'POST':
  11.         line = request.form['line']
  12.     return render_template('index.html', line=line)
  13.  
  14.  
  15. @app.route('/get-line')
  16. def get_line():
  17.     return line
  18.  
  19.  
  20. if __name__ == '__main__':
  21.     app.run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement