迅雷下载最近经常异常崩溃,下个Python脚本自动监控重启之
2015-07-30 09:54
1006 查看
import os import time import subprocess if __name__=="__main__": print("keep xunlei running"); while 1: str = subprocess.check_output('tasklist') print str if str.find('ThunderPortable.exe')==-1: print("xunlei is crashed, restart"); #os.spawnl(os.P_NOWAIT, r'C:\ThunderPortable\ThunderPortable.exe') subprocess.Popen(["ThunderPortable.exe"]) else: print("xunlei is running!"); time.sleep(30)
相关文章推荐
- python字符串格式化
- Python HTML Resolution Demo - SGMLParser & PyQuery
- 用python编写mapreduce版的wordcount程序
- Python 类介绍
- Python的迭代器和生成器
- python for else primers
- python的正则表达式 re
- python的正则表达式 re
- Python type类具体的三大分类:metaclasses,classes,instance
- Python type类具体的三大分类:metaclasses,classes,instance
- python开发_大小写转换,首字母大写,去除特殊字符
- python开发_大小写转换,首字母大写,去除特殊字符
- python的str,unicode对象的encode和decode方法, Python中字符编码的总结和对比bytes和str
- python的str,unicode对象的encode和decode方法, Python中字符编码的总结和对比bytes和str
- Python图形界面开发包 PyGTK
- Python图形界面开发包 PyGTK
- python使用easygui写图形界面程序
- python使用easygui写图形界面程序
- python 可变对象与不可变对象
- opencv-python 学习笔记2:实现目光跟随(又叫人脸跟随)