test.py 1019 B

12345678910111213141516171819202122232425262728293031323334
  1. from flask import Flask, jsonify, render_template, request
  2. app = Flask(__name__)
  3. @app.route('/',methods=['POST', 'GET'])
  4. def index():
  5. if request.method == 'POST':
  6. if request.values['send'] == '送':
  7. return render_template('index.html', name=request.values['axv'])
  8. elif request.values['pos'] == '送出':
  9. return render_template('index.html', name=request.values['user'])
  10. return render_template('index.html', name="")
  11. @app.route('/SomeFunction',methods=['POST', 'GET'])
  12. def SomeFunction():
  13. if request.method == 'POST':
  14. x123 = 'fuck SomeFunction'
  15. print(x123)
  16. return render_template('index.html',x123=x123)
  17. return render_template('index.html')
  18. @app.route('/fuck',methods=['POST', 'GET'])
  19. def fuck():
  20. if request.method == 'POST':
  21. xx = 'fuck'
  22. print(xx)
  23. return render_template('index.html',xx=xx)
  24. return render_template('index.html')
  25. if __name__ == '__main__':
  26. app.run()