import sys
from PyQt5.QtWidgets import QApplication, QWidget, QLabel
def window():
app = QApplication(sys.argv) # create a pyqt5 app
widget = QWidget() # create Window within the app
textLabel = QLabel(widget) # create a label within the widget
textLabel.setText("Hello World From PyQt5 !") # adding a text to the label
textLabel.move(120,80) # label dimensions
widget.setGeometry(100,100,400,200) # window dimensions
widget.setWindowTitle("First PyQt5") # window title
widget.show()
sys.exit(app.exec_())
if __name__ == '__main__':
window()
Younes Derfoufi
my-courses.net
my-courses.net
No comments:
Post a Comment