PyQt(一创建窗口)

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):
    # 设置长宽和显示坐标x,y   # self.setGeometry(400,400,500,500)
    # 同样 self.resize(500,500) self.move(300,300)
    # 窗口标题 self.setWindowTitle('Icon')
self.show() if __name__ == '__main__': app = QApplication(sys.argv) ex = Example() sys.exit(app.exec_())

  

猜你喜欢

转载自www.cnblogs.com/ShanCe/p/11696104.html