Windows+Python使用PyQt5----简单样例(二)
使用PyQT图片加载
import sys
from PyQt5.QtWidgets import QApplication, QMainWindow, QLabel, QGridLayout, QWidget
from PyQt5.QtGui import QPixmap
class Example(QWidget):
def __init__(self):
super().__init__()
self.im = QPixmap("./test.png")
self.label = QLabel()
self.label.setPixmap(self.im)
self.label1 = QLabel()
self.label1.setPixmap(self.im)
self.grid = QGridLayout()
self.grid.addWidget(self.label,1,1)
self.grid.addWidget(self.label1,2,2)
self.setLayout(self.grid)
self.setGeometry(250,250,320,200)
self.setWindowTitle("PyQT show image")
self.show()
if __name__ == '__main__':
app = QApplication(sys.argv)
ex = Example()
sys.exit(app.exec_())

使用PyQT下拉选择
import sys
from PyQt5