Python >> Tutoriel Python >  >> Python GUI >> PyQt GUI

Python 3 PyQt5 Afficher l'image sur l'écran de toile à l'aide de l'application de bureau QPixmap Class Widget GUI

Python 3 PyQt5 Afficher l'image sur l'écran de toile à l'aide de l'application de bureau QPixmap Class Widget GUI

import sys
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *

def window():
   app = QApplication(sys.argv)
   win = QWidget()
   l1 = QLabel()
   l1.setPixmap(QPixmap("profile.jpg"))

   vbox = QVBoxLayout()
   vbox.addWidget(l1)
   win.setLayout(vbox)
   win.setWindowTitle("QPixmap Demo")
   win.show()
   sys.exit(app.exec_())

if __name__ == '__main__':
   window()