Windows service in production?

Tim Golden mail at timgolden.me.uk
Wed Aug 17 08:17:22 EDT 2011


On 16/08/2011 15:46, snorble wrote:
> Interesting. Normally I would use py2exe then do "myapp.exe -install"
> to install the app as a service. How do you handle installing the
> service? Also what does the service show under the properties, for the
> executable? "python.exe script.py" or something else?

To install, I simply invoke the Command-line handler which comes with 
the pywin32 service utils:

if __name__ == '__main__':
   win32serviceutil.HandleCommandLine (Service)

(I imagine that's what py2exe's doing for you behind the scenes).

The executable shows as pythonservice.exe. The short and long
display names can of course be whatever you like.

TJG



More information about the Python-list mailing list