RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
创新互联Python教程:python如何判断一个进程是否存在

python如何判断一个进程是否存在?

python学习网,大量的免费python视频教程,欢迎在线学习!

相关推荐:《Python教程》

源代码如下:

#-*- 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如何判断一个进程是否存在
文章位置:http://www.jxjierui.cn/article/djjgieh.html