Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

basic pyqt5 setup

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
Source by www.techwithtim.net #
 
PREVIOUS NEXT
Tagged: #basic #setup
ADD COMMENT
Topic
Name
1+9 =