我目前正在将python3线程模块与以下代码一起使用,但是我一直收到错误消息,并且我不确定该是什么错误。
代码:
threadA = threading.Thread(target=graph_A)
threadB = threading.Thread(target=graph_B)
threadC = threading.Thread(target=graph_C)
numOfThreads = 3
threadList = []
for i in range(numOfThreads):
threadA.start()
threadList.append(threadA)
threadB.start()
threadList.append(threadB)
threadC.start()
threadList.append(threadC)
错误:
WARNING: QApplication was not created in the main() thread.
Segmentation fault (core dumped)
请注意,每个函数在没有线程的情况下都能正常工作,因此在代码中的其他任何地方都不会出错