Help needed with Windows Service in Python

Mark Hammond skippy.hammond at
Fri Sep 3 02:38:30 CEST 2010

On 3/09/2010 1:22 AM, Ian Hobson wrote:
> Hi All,
> I am attempting to create a Windows Service in Python.
> I have the framework (from Mark Hammond and Andy Robinason's book)
> running - see below. It starts fine - but it will not stop. :(
> net stop "Python Service"
> and using the services GUI both leave the services showing it as "stopping"
> I guess this means SvcStop is called but it is not enough to get it out
> of the machine.
> Does anyone know why not?

I expect that the Windows Event Log might have some clues, as would 
attempting to use it in "debug" mode.

> def SvcStop(self):
> self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
> wind32event.SetEvent(self.hWaitStop)

Note the typo in the line above...


More information about the Python-list mailing list