1. install brew
        

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

 

2. install python3

brew install python3 
brew info python3
python3 -V

 

3. install sip & pyqt5

pip3 install sip
pip3 install pyqt5

 

simple.py

import sys
from PyQt5.QtWidgets import QMainWindow, QTextEdit, QApplication, qApp, QAction
from PyQt5.QtGui import QIcon


class simple(QMainWindow):

    def __init__(self):
        super().__init__()
        self.initUI()

    def initUI(self):
        self.setWindowTitle('hello')
        self.setObjectName("helloWin")
        self.resize(500, 300)

if __name__ == '__main__':
    app = QApplication(sys.argv)
    ex = simple()
    ex.show()
    sys.exit(app.exec_())
View Code

相关文章: