Ask coding questions

← Back to all posts
How do I make this stay alive?
h
VulcanWM (2771)

This code works but when I exit the repl it stops working. What can I do to make it go on forever even when I close the repl?

Answered by CodeMaster007 (108) [earned 5 cycles]
View Answer
Comments
hotnewtop
CodeMaster007 (108)

Hey! So on the repl docs (https://docs.replit.com/repls/always-on), it says that you can enable a repl to be always on. To do this, you need the hacker plan, which you have. It states....
"
1. Navigate to your repl.
2. open the info panel by clicking on your repl's name.
3. Enable Always-on by clicking on the toggle at the bottom
"

CodeMaster007

VulcanWM (2771)

so the console will run forever? @CodeMaster007

VulcanWM (2771)

okay thanks, ill make ur answer as the answer! @CodeMaster007

OldWizard209 (1544)

You can use the threading module by using asynchronous ways of running threads to gether. It could potentially run forever

OldWizard209 (1544)

you need to have always-on which come s with the hacker plan and you have it, so turn it on it and it will run forever.

FloCal35 (666)

Enable always on in the top left menu by the repl title