手机
当前位置:查字典教程网 >脚本专栏 >python >python 判断一个进程是否存在
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线程锁(thread)学习示例

Python 元组(Tuple)操作详解

Python isinstance判断对象类型

Python 字符串中的字符倒转

Python开发实例分享bt种子爬虫程序和种子解析

python 输出一个两行字符的变量

Python linecache.getline()读取文件中特定一行的脚本

Python3 入门教程 简单但比较不错

python 文件与目录操作

Python 分析Nginx访问日志并保存到MySQL数据库实例

精品推荐
分类导航