python ui转py的时候需要加上一点代码不然没反应

import sys
from PyQt5.QtWidgets import QApplication, QMainWindow
import test # module test.py

if __name__ == '__main__':
app = QApplication(sys.argv)
myMainWindow = QMainWindow()
myUi = test.Ui_MainWindow()
myUi.setupUi(myMainWindow)
myMainWindow.show()
sys.exit(app.exec_())
posted @ 2019-12-06 09:59  夜雨声烦丶  阅读(733)  评论(3编辑  收藏  举报