Keep the code running Even If I closed the Visual studio code app - Python language

45 Views Asked by At

I will keep it short. I built a Telegram bot using python on visual studio code. I want the code **to keep running even if I close the app **or my laptop. But unfortunately, when I turn off my computer it will stop working on my Telegram bot.

I used ChatGPT as an assistant. And when I turn off my computer the bot features will be hidden. I tried to use some codes to keep it running, but it's useless. I'm not an expert so may anyone help.

1

There are 1 best solutions below

1
Lajos Arpad On

When you shut down your computer, all the programs that were running on it will stop running. So, if you have a program and you want to run it all the time, then you will either need to keep your computer operational so that the program can run on it, or copy and run your program to another computer that will serve the purposes of a server and will run indefinitely.

If you run it for Visual Studio Code, such as in the case of telethon-vscode, then you will need to run the program to which this is an extension. You need to ask yourself why you want this to run when your computer / VSC are off and decide the path forward for yourself based on your answer to that one.