“Python Pyqt5” Kode Jawaban

Python Pyqt5

# pip install PyQt5==5.15.2
from PyQt5.QtWidgets import QApplication,QMainWindow,QLabel
import sys
app=QApplication(sys.argv)
app.setStyle('Fusion')
app.setApplicationName('PyQt5 App')
win=QMainWindow()
label=QLabel()
label.setText('An App')
win.setCentralWidget(label)
win.show()
sys.exit(app.exec_())
Real Ray

Pengaturan PYQT5 Dasar

from PyQt5 import QtWidgets
from PyQt5.QtWidgets import QApplication, QMainWindow, QLabel
import sys

def main():
    app = QApplication(sys.argv)
    win = QMainWindow()
    win.setGeometry(200,200,300,300) 
    win.setWindowTitle("My first window!") 
    
    label = QLabel(win)
    label.setText("my first label")
    label.move(50, 50)  

    win.show()
    sys.exit(app.exec_())

main()  # make sure to call the function
Gleaming Gaur

instalasi pyqt

conda install torchvision -c pytorch
Clear Cormorant

Jawaban yang mirip dengan “Python Pyqt5”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya