Advertisement
BenjaminPlays

keep_away.py

Feb 19th, 2021
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. from flask import Flask
  2. from threading import Thread
  3.  
  4. app = Flask('')
  5.  
  6. @app.route('/')
  7. def home():
  8.     return "Hello. I am alive!"
  9.  
  10. def run():
  11.   app.run(host='0.0.0.0',port=8080)
  12.  
  13. def keep_alive():
  14.     t = Thread(target=run)
  15.     t.start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement