开发者

How to create a service in Python in Windows?

I have found http://code.activestate.com/recipes/576451-how-to-create-a-windows-se开发者_运维知识库rvice-in-python/

But that service does nothing. How can I use that service for running specific Python file?


You can put your business code in SvcDoRun. The sample at your link just logs a message every three seconds. Just don't forget to check self.hWaitStop periodically.

Sometimes it is convenient to create a worker thread and do all work on that thread, or maybe start a child process. An additional complication in this case is that you have to think about synchronization.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜