Python 判断一个进程是否存在,python进程,#-*- coding:
文章由Byrx.net分享于2019-03-23 07:03:25
Python 判断一个进程是否存在,python进程,#-*- coding:
#-*- coding:utf-8 -*-import win32com.clientdef 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_nameif __name__ == '__main__': check_exsit('chrome.exe')#该片段来自于http://byrx.net
评论关闭