Description Field in WinXP Services
rbt
rbt at athop1.ath.vt.edu
Sat Jan 29 12:53:37 EST 2005
How does one associate a "Description" with a Windows service written in
Python? I've just started experimenting with Python services. Here's my
code... copied straight from Mr. Hammond's "Python Programming on Win32":
import win32serviceutil
import win32service
import win32event
class test_py_service(win32serviceutil.ServiceFramework):
_svc_name_ = "test_py_service"
## Tried the following to no avail.
_svc_description_ = "Test written by Brad"
_svc_display_name_ = "Test Python Service"
def __init__(self, args):
win32serviceutil.ServiceFramework.__init__(self, args)
self.hWaitStop = win32event.CreateEvent(None, 0, 0, None)
def SvcStop(self):
self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
win32event.SetEvent(self.hWaitStop)
def SvcDoRun(self):
win32event.WaitForSingleObject(self.hWaitStop,
win32event.INFINITE)
if __name__ == '__main__':
win32serviceutil.HandleCommandLine(test_py_service)
More information about the Python-list
mailing list