警告:QApplication未在main()线程中创建

2024-04-20 03:50:44 发布

您现在位置:Python中文网/ 问答频道 /正文

当我试图使用~threading module~开发一个并行python应用程序时,我得到以下错误

Python Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)"

我使用的是python3.6、Linux 16.04和Pycharm 2018

我不明白原因和如何解决它。在

代码示例:

numOfThread = 8
class myThread (threading.Thread):
   def __init__(self, thread_id, name, frames):
      threading.Thread.__init__(self)
      self.thread_id = thread_id
      self.name = name
      self.frames = frames
      self.out_frame = None

   def run(self):
      print("Starting " + self.name)
      self.out_frame = trackingmario(self.frames)


list_of_threads = []

print("Start.....\n")

for i in range(numOfThread):
    list_of_threads.append(myThread(i, 'thread_'+str(i), lists[i]))


for i in range(numOfThread):
    list_of_threads[i].start()

for ti in list_of_threads:
    ti.join()

Image show the error : "Python Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)"


Tags: ofnameinselfidforframeswith