Advertisement
Guest User

main.py

a guest
Jul 14th, 2021
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. from PyQt5.QtWidgets import QMainWindow, QLabel, QApplication
  2.  
  3.  
  4. class MainWindow(QMainWindow):
  5. def __init__(self):
  6. super(MainWindow, self).__init__()
  7.  
  8. self.window_configurations()
  9. self.frontend()
  10.  
  11. def window_configurations(self):
  12.  
  13. self.resize(500, 500)
  14. self.setWindowTitle("Hello World PyQt5 GUI")
  15.  
  16. def frontend(self):
  17.  
  18. label = QLabel(self)
  19. label.setText("Hello World")
  20. label.move(200, 200)
  21. label.show()
  22.  
  23.  
  24. def main():
  25. application = QApplication([])
  26. window = MainWindow()
  27. window.show()
  28. application.exec_()
  29.  
  30.  
  31. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement