Ask coding questions

← Back to all posts
running forever
azadkumar (0)

is there any way through which I can make my script run 24*7 without logging in to Replit.

CosmicBear (56)

use a pinger such as
Edit: so that is only for websites. Instead, make another file and insert this code:

from flask import Flask
from threading import Thread

app = Flask(__name__)

def home():
    return "hello world"

def run():'',port=8080)

def keep_alive():  
    t = Thread(target=run)

Then import the keep_alive function and run it before the rest of your code. Then, add the url to the pinger thingy.
Edit 2: it seems that you already have this in your code.

azadkumar (0)

@CosmicBear which url should i add to pinger

azadkumar (0)

@CosmicBear i am trying to run my code ,it does not even create any server it says repl is running at ip(localhost), please see if i have any changes to do with my code

FishballNooodle (213)

Hi please check my pinned repl named forever
For full instructions
I also have a series of discord bot tutorials

FloCal35 (671)

Replit has something called Always on repls, but it's a hacker feature. If you want it, you need to upgrade