0

I have found http://code.activestate.com/recipes/576451-how-to-create-a-windows-service-in-python/

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

bluish
  • 26,356
  • 27
  • 122
  • 180
sam
  • 979
  • 1
  • 7
  • 4

1 Answers1

1

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.

atzz
  • 17,507
  • 3
  • 35
  • 35