1.最后发现是
random.randint(1,len(str))越界 randint左闭右闭 。。。。
2.线程调用了主窗口控件功能 如:
self.bts.textBrowser.clear()
导致-1073741819 (0xC0000005)错误 原因未知
3.线程调用了主窗口控件功能 如:
self.obj.send_message()
-1073740791 (0xC0000409)。。
最后发现是参数没设对
MyQTE(self)写成了MyQTE(self.widge) 然后self.obj.send_message()就变成self.widge.obj.send_message() 但没这个东西 所以报错
题外话:
当我创建了QThread对象thread2
self.bts.thread2.stop() 时程序退出报错
其中quit exit方法没用
self.bts.thread2.isRunning()调用exit方法前后仍为true
terminate有用 调用后 isRunning()为false