PyQt (create a window)

import sys
from PyQt5.QtWidgets import QApplication, QWidget
from PyQt5.QtGui import QIcon

class Example(QWidget):
    def __init__(self):
        super().__init__()
        self.initUI()

    initUI DEF (Self): 
    # Set length and width and the display coordinates x, y   Self.setGeometry # (400,400,500,500)
    # same self.resize(500,500) self.move (300, 300)
    # window title self.setWindowTitle('Icon')
self.show() if __name__ == '__main__': app = QApplication(sys.argv) ex = Example() sys.exit(app.exec_())

  

 

Guess you like

Origin www.cnblogs.com/ShanCe/p/11696104.html