Search code examples
python-3.xwmi

Getting error when working with


I am trying to run a code under Python 3.32 64Bit windows 7 , i keep getting following error below any idea or suggestion how to work with WMI , i tried WMI from pypy but its related to same error Please advice Thanks

ImportError: No module named 'win32com'

from win32com.client import GetObject
WMI = GetObject('winmgmts:')

#List all processes
processes = WMI.InstancesOf('Win32_Process')
for process in processes:
    print (process.Properties_('Name'))

    #Get a specific process
    p = WMI.ExecQuery('select * from Win32_Process where Name="chrome.exe"')
    #view all possible properties
for prop in p[0].Properties_:
   print (prop)
   #print out PID
   print (p[0].Properties_('ProcessId').Value)

Solution

  • Solved the problem by downloading

    Python for Windows extensions

    from sourceforge and keep using Python x64

    Thanks All