service windows avec py2exe

DarkPearl cbarbez at gmail.com
Sat Nov 11 05:51:05 EST 2006


I found the function which starts the error

**********************************
class Win32ProcessUsage:
    def __init__(self):
        self.lstProcess=[]
        self.WMIService =
win32com.client.GetObject(r"winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
        self.reset()
    def reset(self):
        self.lstProcess=[]
        lstTmp = self.WMIService.ExecQuery('Select * from
Win32_Process')
        for item in lstTmp:

self.lstProcess.append(tuple([item.Name,item.CommandLine,item.Status,item.ProcessId,item.ParentProcessId]))

    def get_usage(self):
        return self.lstProcess
**********************************

it is a class which allows to obtain the list of the processes who run.

With python interpreter, this class functions very well but , when it
turns in service, it starts the error :

The instance's SvcRun() method failed
<Error getting traceback - traceback.print_tb() failed
<class 'pywintypes.com_error'>: (-2147221020, 'Syntaxe incorrecte',
None, None)

Why ???




More information about the Python-list mailing list