document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. from flask import Flask, jsonify
  2. from threading import Thread
  3. from time import sleep
  4.  
  5. balbula_1 = True
  6. input1 = 100
  7.  
  8. app = Flask(__name__)
  9.  
  10. @app.route("/data")
  11. def data():
  12.     return jsonify(**{\'balbula_1\': balbula_1, \'input1\': input1})
  13.  
  14. @app.route("/set_balbula_1/<int:value>")
  15. def set_balbula_1(value):
  16.     global balbula_1
  17.     balbula_1 = bool(value)
  18.     return \'\'
  19.  
  20.  
  21. def f():
  22.     while True:
  23.         sleep(1)
  24.         global input1
  25.         input1 -= 1
  26.         input1 += balbula_1*2
  27.         print input1
  28.  
  29. if __name__ == "__main__":
  30.     Thread(target=f).start()
  31.     app.run()
');