一个项目里面需要一个奔溃后发送错误日志的功能。
因为要打包exe, 所以不想写另外一个新exe。然后监控PID什么的。想在一个py。里面完成。求大神给方案
这个是简单的奔溃代码。
from multiprocessing import Process
import time
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
got_error = 'got!!'
def timetask():
try:
while 1:
time.sleep(.1)
except:
print got_error
aaa = QApplication(sys.argv)
p = Process(target = timetask,)
if __name__ == '__main__':
p.start()
for a in xrange(1000):
az = QThread()
az.start()
p.join()
try:
aaa.exec_()
except:
print got_error
富国沪深
慕桂英3389331
相关分类