【发布时间】:2017-03-17 17:39:56
【问题描述】:
我在 Windows 上使用 waitress 和 falcon 编写了一个 API 服务器。它工作得很好,但现在我需要将它作为服务运行,以便它可以监控。最好的方法是什么?我看过 pywin32 和 cherrypy's own implementation。我很难通过 python 阻止女服务员。我知道使用 cmd 时使用 ctrl-break,但不确定使用 python 时使用什么。
def SvcStop(self):
self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
cherrypy.server.stop()
win32event.SetEvent(self.stop_event)
我没有看到女服务员有像cherrypy这样的停止功能。
任何帮助都会很棒。即使它在pywin32之外。只需要一些关于如何让服务员在 Windows 上作为服务运行的详细信息,因为有很多方法可以做到这一点,我不确定推荐哪种方法。
谢谢, 安东尼
【问题讨论】:
标签: python windows service pywin32 waitress