Created a script that implements the windows service according to the idea:
import win32serviceutil import win32service from multiprocessing import Process import helloworld class Service(win32serviceutil.ServiceFramework): _svc_name_ = "TestService" _svc_display_name_ = "Test Service" _svc_description_ = "Tests Python service framework by receiving and echoing messages over a named pipe" def __init__(self, *args): super().__init__(*args) def SvcStop(self): self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING) self.process.terminate() self.ReportServiceStatus(win32service.SERVICE_STOPPED) def SvcDoRun(self): self.process = Process(target=self.main) self.process.start() self.process.run() def main(self): helloworld.run() if __name__ == '__main__': win32serviceutil.HandleCommandLine(AppServerSvc) 
