新聞中心
這里有您想知道的互聯網營銷解決方案
創(chuàng)新互聯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') 網頁標題:創(chuàng)新互聯Python教程:python如何判斷一個進程是否存在
當前URL:http://m.fisionsoft.com.cn/article/djjgieh.html


咨詢
建站咨詢
