import sys
from PyQt5.QtWidgets import QApplication, QWidget
from PyQt5.QtGui import QIcon
class Example(QWidget):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
self.setGeometry(300, 300, 300, 220)
self.setWindowTitle('Icon')
self.setWindowIcon(QIcon('web.png'))
self.show()
if name == 'main':
app = QApplication(sys.argv)
ex = Example()
sys.exit(app.exec_()) import sys
就这种简单的代码,在别的电脑上运行,显示出窗口,关闭窗口,进程结束,什么问题都没有;但是我的电脑关闭窗口后,程序就死循环了,还得重启python,要不啥也干不了,我的电脑是用什么问题?(用的spyder)
应该是你python 环境问题,试试将python卸载重装