python3 檢測進程是否存在
pip install pywin32
import win32com.client
def check_exsit(process_name):
WMI = win32com.client.GetObject('winmgmts:')
processCodeCov = WMI.ExecQuery('select * from Win32_Process where Name="%s"' % process_name)
if len(processCodeCov) > 0:
print ('%s is exists' % process_name)
else:
print ('%s is not exists' % process_name)
if __name__ == '__main__':
check_exsit('360se.exe')
posted on 2018-05-19 12:06 AlanTop 閱讀(472) 評論(0) 編輯 收藏 引用 所屬分類: Python