我认为问题出在您的start.py文件上。您有一个refreshgui函数,可以重新导入start.py
导入将运行文件中代码的每个部分。通常将主要功能包装在’if name ==’main‘:中,以防止代码在导入时运行。
每当您拥有多个QApplication或QCoreApplication时,都会发生错误。
if __name__ == '__main__': # only executes the below pre if it python has run it as the main app = QtGui.QApplication(sys.argv) # before this was getting called twice myapp = StartQT4() myapp.show() threadhandler.variablesinitialize() threadhandler.functionsinitialize() timer = QtCore.QTimer() timer.timeout.connect(functions.refreshgui) # I believe this re-imports start.py which calls all of this pre again. timer.start(1000) sys.exit(app.exec_())



