python怎么判断进程是否杀掉?
python中可以通过判断进程是否存在来判断进程是否被杀掉:
python中可以使用win32com库来获取进程信息。
importwin32com.client defcheck_exsit(process_name): WMI=win32com.client.GetObject('winmgmts:') processCodeCov=WMI.ExecQuery('select*fromWin32_ProcesswhereNamelike"%{}%"'.format(process_name)) iflen(processCodeCov)>0: returnTrue else: returnFalse if__name__=='__main__': res=check_exsit('tray.exe') print(res)
更多Python知识请关注Python自学网。
本网站文章仅供交流学习 ,不作为商用, 版权归属原作者,部分文章推送时未能及时与原作者取得联系,若来源标注错误或侵犯到您的权益烦请告知,我们将立即删除.