标签:self pre cat 运行 定义 括号 exit exe imp
import sys from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.QtCore import * # 定义一个方法,用来运行主函数 def main(): app = QApplication(sys.argv) exit(app.exec_()) if __name__ == "__main__": main()
import sys from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.QtCore import *
from PyQt5.Qt import *
# 定义一个方法,用来运行主函数 def main(self): app = QApplication(sys.argv) main = self() main.show() exit(app.exec_()) if __name__ == "__main__": ###这里输入上面的窗口名,不要括号### main(self)
标签:self pre cat 运行 定义 括号 exit exe imp
原文地址:https://www.cnblogs.com/dandanduba/p/12515331.html