I have a python code implementing a server with API service. I want to run this code endlessly over VM with windows server image. Running the code from command line is stopped after log off. So, the question is how it can be achieved, considering the VM can be logged on and or logged off.
Moreover, how it can be ensured that the code will be re-runned after an unexpexted crush.
In general i am looking to os/python solution and not third part solution.