0
How can I make a script run forever?
I am making a discord bit with python and the bit keeps going offline when I close the text editor and wait till the next morning it's offline. I believe I need to make the script run forever but if so how so I do that? If that's not what I need to do please tell what I do need to do? Don't know if it will help but the bot is coded in python.
3 odpowiedzi
+ 3
self hosting ? yeah dont run the script from text editor, the trrminal used by text editor attach itself to it as a child, thus will close when the parent/editor are closed.
just open a new cmd/terminal yourself then run the script from there.
you can leave it minimized
0
Taste would I need to leave the cmd or can I close it? And what what I type in the cmd terminal to run it?
0
you cant close it, it close along with the bot.
to run it go to your project directory then type
python main.py
main.py could be any file you're using as the entry point