Ask coding questions

← Back to all posts
Keep python repl 24/7 on
Zumodenaranja73 (0)

hi anyone knows how to keep a PYTHON repl alwyas on? Thanks

Answered by Coder100 (18071) [earned 5 cycles]
View Answer
Comments
hotnewtop
Coder100 (18071)

Just make an HTTP server!

from threading import Thread
from flask import Flask

app = Flask.app("test")
@app.route("/")
def main():
  return "alive!"

def run():
  app.run(host='0.0.0.0', port=8080)

t = Thread(target = run)
t.start()

# ... add your code here ...
RYANTADIPARTHI (6019)

You have to use a hosting site. Like a HTTP server, and host it there.

CoolJames1610 (764)

Use Flask and uptimer robot to ping the web page