This recipe demonstrates a simple windows service using the win32service module. Another recipe is here.[1] [2]