Hi,
When trying to import the WMI module in a Python Windows Service, I get
the following:
dynamic module does not define init function (initwmi)
The WMI version is 0.6. Python 2.4 on Win32, Python Win32 extensions
version 203
Code below,
Cam.
def SvcDoRun(self):
import servicemanager
servicemanager.LogMsg(servicemanager.EVENTLOG_INFO RMATION_TYPE,
servicemanager.PYS_SERVICE_STARTED, (self._svc_name_, ''))
print "Running..."
try:
import wmi
print "module imported"
except Exception, e:
print "exception: " + str(e)
print "Stopped."
self.ReportServiceStatus(win32service.SERVICE_STOP PED)
servicemanager.LogMsg(
servicemanager.EVENTLOG_INFORMATION_TYPE,
servicemanager.PYS_SERVICE_STOPPED,
(self._svc_name_, "EventMonSvc stopping..." )
)