栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

事件循环已经在运行

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

事件循环已经在运行

我认为问题出在您的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_())


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/624635.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号