python 判断一个进程是否存在
摘要:源代码如下:复制代码代码如下:#-*-coding:utf-8-*-defcheck_exsit(process_name):importw...
源代码如下:
复制代码 代码如下:
#-*- coding:utf-8 -*-
def check_exsit(process_name):
import win32com.client
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('chrome.exe')
【python 判断一个进程是否存在】相关文章:
★ python基于mysql实现的简单队列以及跨进程锁实例详解
★ python中from module import * 的一个坑
★ Python 分析Nginx访问日志并保存到MySQL数据库实例