Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run python in terminal and don't terminate when terminal is closed [closed]

Tags:

People also ask

How do I run a Python file in the background?

The easiest way of running a python script to run in the background is to use cronjob feature (in macOS and Linux). In windows, we can use Windows Task Scheduler.

How do I run a Python program in the background in Linux?

To run Python scripts as a background process on Linux or Mac, we use the & operator at the end of the command, which will make it run as a background process.


I need to make static website. So I connected via ssh to some local server, where I want to make a static website. Then I used python to make it work:

$ python -m http.server 55550

But if I close terminal, then python program is terminated. I want to shut down my computer, but I want to let this process running on that local server, so other people could still access that website.

How can I do this? After that, how should I terminate that process later?

Thanks for any help